Filament: Make Table Row Clickable and Lead to View Page

A 2-in-1 tip. You may specify that not only does the "Edit" action call the Edit page, but a click anywhere on the row would do the same.

use App\Filament\Resources\CustomerResource\Pages;
 
public function table(Table $table): Table
{
return $table
// ...
->recordUrl(
fn (Model $record): string => Pages\EditCustomer::getUrl([$record->id]),
);
}

But also, you may override where it leads to: for example, specify a View page instead of the Edit page.

use App\Filament\Resources\CustomerResource\Pages;
 
public function table(Table $table): Table
{
return $table
// ...
->recordUrl(
fn (Model $record): string => Pages\ViewCustomer::getUrl([$record->id]),
);
}

Like our articles?

Become a Premium Member for $129/year or $29/month
What else you will get:
  • 59 courses (1057 lessons, total 42 h 44 min)
  • 79 long-form tutorials (one new every week)
  • access to project repositories
  • access to private Discord

Recent Premium Tutorials