This is probably (?) an issue I missed after upgrading to Laravel 11, but I'm getting this error on trying to fetch (not save) decimal data from DB in Laravel 11 Filament V3:
Brick\Math\BigDecimal::toScale(): Argument #1 ($scale) must be of type int, string given, called in /app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php on line 1432
Triggered by
$this->form->fill(auth()->user()->companies->find($companyID)->relationship->attributesToArray());
I already checked the documentation (https://laravel.com/docs/11.x/upgrade#floating-point-types) and updated my migration (https://laravel.com/docs/11.x/migrations#column-method-decimal):
$table->decimal('from', total: 4, places: 3)->nullable();
$table->decimal('to', total: 4, places: 3)->nullable();
Model is unchanged but I don't see anything wrong with it
protected $casts = [
'from' => 'decimal:4,3',
'to' => 'decimal:4,3',
TablePlus says columnType is decimal (4,3), so there's absolutely no way I'm passing a string here. It used to work just fine (populating forms with data)...
Any help would be much appreciated!