Can I make a TextColumn relationship linkable like in Laravel Nova ?

Here is an exemple with the Category column in Nova, I'd like to replicate the same effect in Filamentphp
No description
13 Replies
Azad Furkan ŞAKAR
...
TextColumn::make('category.name')
->label('Category')
->url(fn ($record) => CategoryResource::getUrl('view', ['record' => $record->category])),
...
...
TextColumn::make('category.name')
->label('Category')
->url(fn ($record) => CategoryResource::getUrl('view', ['record' => $record->category])),
...
mrleblanc101
mrleblanc101OP2mo ago
@Azad Furkan ŞAKAR There is nothing baked-in for this ? Seems very verbose
mrleblanc101
mrleblanc101OP2mo ago
GitHub
TextColumn/TextEntry Relation with links · filamentphp filament ·...
I've extended the TextColumn/TextEntry and added a feature to include a link if the data has a resource. Hopefully, this can be added to Filament as a default option, but feel free to use it in...
GitHub
clickable / linked relationship · filamentphp filament · Discussi...
I need some Fields to be linked to the corresponding relationship eg.: In my house resource form i show the customer_id, which should be linked to the owner of the house, so i can move fast between...
GitHub
Clickable relationship columns/entries · filamentphp filament · D...
I would like to see a method to open a view/edit modal/slideover/page for a relationship column/entry on click. Currently to implement this you would have to do something like this: TextEntry::make...
Azad Furkan ŞAKAR
You can make custom column for this
mrleblanc101
mrleblanc101OP2mo ago
Very odd, hopefully it get added natively in a future version of filamentphp
Dan Harrin
Dan Harrin2mo ago
its deliberately verbose, we dont do "magic" as it makes things difficult to customise and slow i dont think 1 line is too bad to add a link
mrleblanc101
mrleblanc101OP2mo ago
@Dan Harrin I don't mind addind a method like ->url(), but to me it feels very odd havind to add the callback inside everywhere (fn ($record) => CategoryResource::getUrl('view', ['record' => $record->category])). Couldn't we have something like UrlColumn::make('category.name')->relationship(Model::class) (a UrlColumn would automatically like to the relationship when passing the ->relationship modifier) or RelationshipColumn::make('category.name')->url() (a RelationshipColumn would automatically link to the relationship when using the ->url() modifier)
Dan Harrin
Dan Harrin2mo ago
then you have to add automatic resource discovery, what happens if there are two resources for the same model it just doesn’t fit with filaments api philosophy
mrleblanc101
mrleblanc101OP2mo ago
Wouldn't that work ? UrlColumn::make('category.name')->relationship(CategoryResource::class) tho ?
Dan Harrin
Dan Harrin2mo ago
then you need to add page & url param customisation and panel customisation i dont think its worth it
mrleblanc101
mrleblanc101OP2mo ago
I like that Nova does this by default, no need for complex callback poluting everywhere
No description
mrleblanc101
mrleblanc101OP2mo ago
Here is a screenshot in a recent version
No description
Dan Harrin
Dan Harrin2mo ago
they are different products with different philosophies. we dont do as much magic

Did you find this page helpful?