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

13 Replies
@Azad Furkan ŞAKAR There is nothing baked-in for this ? Seems very verbose
I guess not:
https://github.com/filamentphp/filament/discussions/15292
https://github.com/filamentphp/filament/discussions/4382
https://github.com/filamentphp/filament/discussions/13094
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...
You can make custom column for this
Very odd, hopefully it get added natively in a future version of filamentphp
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
@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)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
Wouldn't that work ?
UrlColumn::make('category.name')->relationship(CategoryResource::class)
tho ?then you need to add page & url param customisation
and panel customisation
i dont think its worth it
I like that Nova does this by default, no need for complex callback poluting everywhere

Here is a screenshot in a recent version

they are different products with different philosophies. we dont do as much magic