PHPackages                             brokeyourbike/country-casts-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. brokeyourbike/country-casts-laravel

ActiveLibrary[Database &amp; ORM](/categories/database)

brokeyourbike/country-casts-laravel
===================================

Cast Laravel country code attributes from ISO3 to ISO2

0.1.2(2y ago)01.0k[1 PRs](https://github.com/brokeyourbike/country-casts-laravel/pulls)MPL-2.0PHPPHP ^8.0CI failing

Since Dec 21Pushed 2y ago1 watchersCompare

[ Source](https://github.com/brokeyourbike/country-casts-laravel)[ Packagist](https://packagist.org/packages/brokeyourbike/country-casts-laravel)[ RSS](/packages/brokeyourbike-country-casts-laravel/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (3)Dependencies (5)Versions (5)Used By (0)

country-casts-laravel
=====================

[](#country-casts-laravel)

[![Latest Stable Version](https://camo.githubusercontent.com/0a74d0785cef6b09648b3f2eba95de10533e21b52fd2b553780762b7b0041d0c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f62726f6b65796f757262696b652f636f756e7472792d63617374732d6c61726176656c)](https://github.com/brokeyourbike/country-casts-laravel/releases)[![Total Downloads](https://camo.githubusercontent.com/8a62564f8d72a494df36cdd6b879c88733a1884cca9114b90aabe9149f900603/68747470733a2f2f706f7365722e707567782e6f72672f62726f6b65796f757262696b652f636f756e7472792d63617374732d6c61726176656c2f646f776e6c6f616473)](https://packagist.org/packages/brokeyourbike/country-casts-laravel)[![Maintainability](https://camo.githubusercontent.com/6573174128b4cbe3bada0e78fe7ae185f34a4bc37e8578c8935da821d9208462/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f34363863393961303138323763333662323731632f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/brokeyourbike/country-casts-laravel/maintainability)[![Test Coverage](https://camo.githubusercontent.com/4d6b12321a54a2dccdb90b2d9a81e5746feed73c480058b5a7c8b803b58013f2/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f34363863393961303138323763333662323731632f746573745f636f766572616765)](https://codeclimate.com/github/brokeyourbike/country-casts-laravel/test_coverage)

Cast country code attributes from ISO3 to ISO2

Installation
------------

[](#installation)

```
composer require brokeyourbike/country-casts-laravel
```

Usage
-----

[](#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
-------

[](#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
-------

[](#license)

[Mozilla Public License v2.0](https://github.com/brokeyourbike/country-casts-laravel/blob/main/LICENSE)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 78.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~254 days

Total

3

Last Release

1094d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/114f3c6e8506e0bba763451e8e4bcc3e94d662c2dce982a910b5d7b3444593cf?d=identicon)[brokeyourbike](/maintainers/brokeyourbike)

---

Top Contributors

[![brokeyourbike](https://avatars.githubusercontent.com/u/1554371?v=4)](https://github.com/brokeyourbike "brokeyourbike (11 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (3 commits)")

---

Tags

attributescastingeloquenthacktoberfestlaravellaravel-8laravel-8-packagelaravel-packagephpphp8

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/brokeyourbike-country-casts-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/brokeyourbike-country-casts-laravel/health.svg)](https://phpackages.com/packages/brokeyourbike-country-casts-laravel)
```

###  Alternatives

[spatie/laravel-backup

A Laravel package to backup your application

6.0k21.8M191](/packages/spatie-laravel-backup)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[kreait/laravel-firebase

A Laravel package for the Firebase PHP Admin SDK

1.3k16.5M42](/packages/kreait-laravel-firebase)[bavix/laravel-wallet

It's easy to work with a virtual wallet.

1.3k1.1M11](/packages/bavix-laravel-wallet)[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
