brokeyourbike / country-casts-laravel
Cast Laravel country code attributes from ISO3 to ISO2
Fund package maintenance!
brokeyourbike
Open Collective
Requires
- php: ^8.0
- illuminate/contracts: ^8|^9
- league/iso3166: ^4.0
Requires (Dev)
- bamarni/composer-bin-plugin: ^1.4
- illuminate/database: ^8|^9
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-09-20 14:20:10 UTC
README
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