© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
9 replies
Eric

Add Button Action To TextColumn

Problem:
Right now, in the events table, my users want to click the row to go to the edit page of the record.
But there is a problem.
I have this TextColumn, which has a url. So if the user clicks the row, but not clicking the text, it opens the TextColumn url.
Tables\Columns\TextColumn::make('user.name')->url(function (Event $record): string {
    return route('filament.admin.resources.users.edit', $record->user_id);
}),
Tables\Columns\TextColumn::make('user.name')->url(function (Event $record): string {
    return route('filament.admin.resources.users.edit', $record->user_id);
}),

So is confusing, because they havent clicked the text of that TextColumn, therefore they don't want to navigate to that TextColumn url, they want to navigate to edit the specified record.

What I want:
So i want to instead of all the TextColumn space, create a button inside of it, so it is clear that if the user clicks the button will go where the button points to. otherwise, will go to edit the clicked row.

What I tried:
I tried to change the
->url
->url
for
->action
->action
:
Tables\Columns\TextColumn::make('user.name')->action(Tables\Actions\Action::make('view_user')->url(function (Event $record): string {
    return route('filament.admin.resources.users.edit', $record->user_id);
})),
Tables\Columns\TextColumn::make('user.name')->action(Tables\Actions\Action::make('view_user')->url(function (Event $record): string {
    return route('filament.admin.resources.users.edit', $record->user_id);
})),

But then, when i click it, it doesn't do anything. If i instead of
->url
->url
I put:
->action(function () {
    dd('hi');
})
->action(function () {
    dd('hi');
})

but is not visible

Question:
Is there a way, without creating a custom col, to add an action in the textcolumn, making it visible & also making the
->url
->url
action to work?
Solution
Maybe this works as an alternative for you:
->description(fn () => new HtmlString('<a class="hover:underline" href="test">» Go to page</a>'))
->description(fn () => new HtmlString('<a class="hover:underline" href="test">» Go to page</a>'))
image.png
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Add CSS To Action Button
FilamentFFilament / ❓┊help
2y ago
Add action button to form
FilamentFFilament / ❓┊help
3y ago
TextColumn action->button not working as expected
FilamentFFilament / ❓┊help
2y ago
Add Button Form Action
FilamentFFilament / ❓┊help
2y ago