Looking to hire Laravel developers? Try LaraJobs

country-casts-laravel maintained by brokeyourbike

Description
Cast Laravel country code attributes from ISO3 to ISO2
Author
Last update
2023/05/20 13:34 (dev-release-v0.1.3)
License
Links
Downloads
1 083

Comments
comments powered by Disqus

country-casts-laravel

Latest Stable Version Total Downloads Maintainability Test Coverage

Cast country code attributes from ISO3 to ISO2

Installation

composer require brokeyourbike/country-casts-laravel

Usage

use Illuminate\Database\Eloquent\Model;
use BrokeYourBike\CountryCasts\Alpha2Cast;

class Order extends Model
{
    protected $casts = [
        'country_code' => 'string',
        'country_code_alpha2' => Alpha2Cast::class . ':country_code',
    ];
}

Authors

License

Mozilla Public License v2.0