yuwuhsien/laravel-bcmath-cast
Laravel Eloquent casts for PHP 8.4's BCMath\Number object, turning model attributes into arbitrary-precision decimals so you can use natural operators like +, -, and * directly while keeping money math exact. Requires PHP 8.4+ and Laravel 12+.
Laravel BCMath Cast integrates Eloquent with PHP 8.4's BCMath\Number object API, so model attributes become arbitrary-precision decimal objects. Use the AsDecimal cast to perform natural operator-based arithmetic—like $product->price - $product->cost—directly on attributes while preserving decimal accuracy.
BCMath\Number instances automaticallyNumber inputsHow can I help you explore Laravel packages today?