-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Open
Copy link
Labels
Milestone
Description
Package
filament/filament
Package Version
v4.0.6
Laravel Version
v12.28.0
Livewire Version
v3.6.4
PHP Version
PHP 8.4
Problem description
Description
When using ->record()
on table toolbarActions
or headerActions
, the explicitly set record is not accessible in the action callback. The record parameter shows as null instead of the expected model instance.
Expected behavior
Expected Behavior
The $record
parameter in the action callback should contain the Student model instance returned from Student::first()
.
Actual Behavior
The $record
parameter is null.
Steps to reproduce
- Create a table with toolbarActions or headerActions
- Use
->record()
to explicitly set a record - Try to access the record in the action callback
- Observe that the record parameter is null
Code Example
use App\Models\Student;
use Filament\Actions\Action;
public static function table(Table $table): Table
{
return $table
->toolbarActions([
Action::make('test')
->record(fn() => Student::first()) // Explicitly setting record
->action(fn($record) => dd($record)), // $record is null here
]);
}
Reproduction repository (issue will be closed if this is not valid)
Relevant log output
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Todo