Skip to content

Table toolbarActions/headerActions record() not accessible in action callback #17649

@AsmitNepali

Description

@AsmitNepali

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

  1. Create a table with toolbarActions or headerActions
  2. Use ->record() to explicitly set a record
  3. Try to access the record in the action callback
  4. 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)

https://github.com/AsmitNepali/course-file/blob/77358006d55ff37aca472a51694f104105433b8b/app/Filament/Resources/Students/StudentResource.php#L44

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    Todo

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions