© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•12mo ago•
3 replies
Batman

Set visibility of component based on current resource

I would like to put a list in a common area to share with the ArticleResource and ArticlesRelationManager (for users resource). Since this is to show articles for a specific user, I do not need the author column to be visible.

I have searched here and in the Docs and I have not found anything with the terminology I was trying to search for.

How can I set visibility based on the
resource
resource
it is being used in similarly to how I have visibility based on
$operation
$operation
below?

`
TextColumn::make('author.name')
                    ->visible(fn (string $operation) => $operation !== 'edit')
                    ->searchable()
                    ->sortable(),
`
TextColumn::make('author.name')
                    ->visible(fn (string $operation) => $operation !== 'edit')
                    ->searchable()
                    ->sortable(),
Solution
Not sure why it didn't hit me sooner??

->visible(fn () => Route::is('filament.admin.resources.users.edit'))
->visible(fn () => Route::is('filament.admin.resources.users.edit'))
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

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Add condition to recordSelectOptionsQuery() based on current resource
FilamentFFilament / ❓┊help
3y ago
Extend Component, set optional schema based on flag
FilamentFFilament / ❓┊help
3y ago
Conditionally modify query based on column visibility
FilamentFFilament / ❓┊help
3y ago
Collapse sections based on resource
FilamentFFilament / ❓┊help
3y ago