PHPackages                             brokeyourbike/money-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/money-casts-laravel

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

brokeyourbike/money-casts-laravel
=================================

Cast attributes to Money object

1.0.4(2y ago)15091[1 PRs](https://github.com/brokeyourbike/money-casts-laravel/pulls)MPL-2.0PHPPHP ^8.0

Since Oct 19Pushed 2y ago1 watchersCompare

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

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

money-casts-laravel
===================

[](#money-casts-laravel)

[![Latest Stable Version](https://camo.githubusercontent.com/722784301d18aa757d7faf406f4ff50eef58ba683e84e3ca94769fa5afd2e5f4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f62726f6b65796f757262696b652f6d6f6e65792d63617374732d6c61726176656c)](https://github.com/brokeyourbike/money-casts-laravel/releases)[![Total Downloads](https://camo.githubusercontent.com/e809cd6d97caaa062a9ed21d2a1f98188136aadec5739308afc7a255661cbded/68747470733a2f2f706f7365722e707567782e6f72672f62726f6b65796f757262696b652f6d6f6e65792d63617374732d6c61726176656c2f646f776e6c6f616473)](https://packagist.org/packages/brokeyourbike/money-casts-laravel)[![Maintainability](https://camo.githubusercontent.com/08d1d1976c9aa9d4bd367d03076c11f0ebce4b200a36596c7c25536314fc7511/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f66393964363539303164373433373066363865302f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/brokeyourbike/money-casts-laravel/maintainability)[![Test Coverage](https://camo.githubusercontent.com/61890cff5021b8f03be5e46f2b612b3951aa2bca044af96caded912e3166188e/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f66393964363539303164373433373066363865302f746573745f636f766572616765)](https://codeclimate.com/github/brokeyourbike/money-casts-laravel/test_coverage)

Cast attributes to [Money](https://github.com/moneyphp/money) objects

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

[](#installation)

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

Usage
-----

[](#usage)

```
use Illuminate\Database\Eloquent\Model;
use BrokeYourBike\MoneyCasts\CurrencyCast;
use BrokeYourBike\MoneyCasts\MoneyCast;

class Order extends Model
{
    protected $casts = [
        'currency' => CurrencyCast::class . ':currency_code',
        'amount' => MoneyCast::class . ':amount_in_cents,currency_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/money-casts-laravel/blob/main/LICENSE)

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 84.4% 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 ~143 days

Total

5

Last Release

1094d ago

PHP version history (2 changes)1.0.0PHP ^7.4 || ^8.0

1.0.3PHP ^8.0

### 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 (27 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (5 commits)")

---

Tags

attributescastingeloquenthacktoberfestlaravellaravel-8laravel-8-packagelaravel-packagemoneyphpphp8

###  Code Quality

TestsPHPUnit

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/brokeyourbike-money-casts-laravel/health.svg)](https://phpackages.com/packages/brokeyourbike-money-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)
