Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brokeyourbike/country-casts-laravel
Cast Laravel country code attributes from ISO3 to ISO2
https://github.com/brokeyourbike/country-casts-laravel
attributes casting eloquent hacktoberfest laravel laravel-8 laravel-8-package laravel-package php php8
Last synced: 8 days ago
JSON representation
Cast Laravel country code attributes from ISO3 to ISO2
- Host: GitHub
- URL: https://github.com/brokeyourbike/country-casts-laravel
- Owner: brokeyourbike
- License: mpl-2.0
- Created: 2021-12-21T15:02:08.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-20T11:34:06.000Z (over 1 year ago)
- Last Synced: 2024-12-17T09:15:09.160Z (about 1 month ago)
- Topics: attributes, casting, eloquent, hacktoberfest, laravel, laravel-8, laravel-8-package, laravel-package, php, php8
- Language: PHP
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# country-casts-laravel
[![Latest Stable Version](https://img.shields.io/github/v/release/brokeyourbike/country-casts-laravel)](https://github.com/brokeyourbike/country-casts-laravel/releases)
[![Total Downloads](https://poser.pugx.org/brokeyourbike/country-casts-laravel/downloads)](https://packagist.org/packages/brokeyourbike/country-casts-laravel)
[![Maintainability](https://api.codeclimate.com/v1/badges/468c99a01827c36b271c/maintainability)](https://codeclimate.com/github/brokeyourbike/country-casts-laravel/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/468c99a01827c36b271c/test_coverage)](https://codeclimate.com/github/brokeyourbike/country-casts-laravel/test_coverage)Cast country code attributes from ISO3 to ISO2
## Installation
```bash
composer require brokeyourbike/country-casts-laravel
```## Usage
```php
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](https://github.com/brokeyourbike) | [Twitter](https://twitter.com/brokeyourbike) | [LinkedIn](https://www.linkedin.com/in/brokeyourbike) | [stasi.uk](https://stasi.uk)## License
[Mozilla Public License v2.0](https://github.com/brokeyourbike/country-casts-laravel/blob/main/LICENSE)