moneybatch / laravel-minimalist
Moneybatch Laravel Minimalist
1.0.0
2021-11-04 14:36 UTC
Requires
- php: ^7.4
- moneybatch/minimalist: ^1.0
Requires (Dev)
- illuminate/contracts: ^8.69
- illuminate/database: ^8.69
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2025-01-18 00:51:39 UTC
README
Working with one currency on Laravel? Need easy, affective and stable way to work with Money? Pick the Laravel Minimalist.
This is a Laravel version of moneybatch/minimalist
Installation
composer require moneybatch/laravel-minimalist
Usage
Money
Moneybatch\LaravelMinimalist\Domain\Money
and Moneybatch\LaravelMinimalist\Domain\Price
are extensions of moneybatch/minimalist and can be used the same way. See details.
Eloquent: Mutators & Casting
To cast the attribute to Money, just use the standard Eloquent model casts
attribute:
protected $casts = [
'balance' => Money::class,
];
Don't forget to import the class prior to using it:
use Moneybatch\LaravelMinimalist\Domain\Money
;