The $record is not found, here the error that I get instead:
App\Filament\Resources\OrderResource::App\Filament\Resources{closure}(): Argument #1 ($record) must be of type Illuminate\Database\Eloquent\Model, null given, called in /Users/zoba-mac/Sites/laravel/navisafe/vendor/filament/support/src/Concerns/EvaluatesClosures.php on line 35
Consider that, few lines below I've the state() declaration for the same column:
...which gives no errors (if I comment the visible() invocation).
Expected behavior
I expect the $record to be correctly evaluated as usual.
Steps to reproduce
1 - create a Filament Resource
2 - add "table" method with any given column
3 - choose any column, call the "visible" method on it, passing a Closure with a Model $record as parameter
Reproduction repository (issue will be closed if this is not valid)
Illuminate \ Contracts \ Container \ BindingResolutionException
PHP 8.2.22
11.8.0
An attempt was made to evaluate a closure for [Filament\Tables\Columns\TextColumn], but [$record] was unresolvable.
Donate 💰 to fund this issue
You can donate funding to this issue. We receive the money once the issue is completed & confirmed by you.
100% of the funding will be distributed between the Filament core team to run all aspects of the project.
Thank you in advance for helping us make maintenance sustainable!
Package
filament/filament
Package Version
3.2.82
Laravel Version
11.8.0
Livewire Version
3.5.0
PHP Version
8.2.22
Problem description
I have a table with simple TextColumn, so defined:
The $record is not found, here the error that I get instead:
Consider that, few lines below I've the state() declaration for the same column:
->state(function (Model $record) { return $record->orderSuppliersToBeApprovedByShipyard()->count(); })
...which gives no errors (if I comment the visible() invocation).
Expected behavior
I expect the $record to be correctly evaluated as usual.
Steps to reproduce
1 - create a Filament Resource 2 - add "table" method with any given column 3 - choose any column, call the "visible" method on it, passing a Closure with a Model $record as parameter
Reproduction repository (issue will be closed if this is not valid)
https://github.com/giovanniledda/navisafe
Relevant log output
Donate 💰 to fund this issue