brokeyourbike / country-casts-laravel
Cast Laravel country code attributes from ISO3 to ISO2
Package info
github.com/brokeyourbike/country-casts-laravel
pkg:composer/brokeyourbike/country-casts-laravel
0.1.2
2023-05-14 22:33 UTC
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: 2026-02-20 17:46:51 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