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
Downloads
1 083
country-casts-laravel
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
- Ivan Stasiuk | Twitter | LinkedIn | stasi.uk