Black Friday: coupon FRIDAY24 for 40% off Yearly/Lifetime membership! Read more here

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:
  • 67 courses (1172 lessons, total 43 h 18 min)
  • 90 long-form tutorials (one new every week)
  • access to project repositories
  • access to private Discord

Recent New Courses