Chrispian
how to get data relationship from table text column in description
Description supports callbacks. There is an example in the docs, just reference the relationship on your model as normal within the callback.
Assuming the relationship name is stock and you want to show the stock's description:
https://filamentphp.com/docs/3.x/tables/columns/text#displaying-a-description
You may have to tweak for your use case but this is what I think you're looking for.
10 replies
Is there any problem if I delete a relation manager just by deleting the created file? Could this co
Probably not related. If this should be a unique value you should make it unique in your database. Just make a new migration and add the unique to it. Laravel has good docs on that if you don’t already know how.
Also, you can add ->unique() to your input and Filament will also check. For unique IDs I recommend doing both.
11 replies
Tabbed container with infolist in one tab, other related tables in the other tabs
Nice! Looks good. I see the sorting issue. I'm betting since it's a modified query + a LW component something needs to be done around that to make it update the table data.
92 replies
Tabbed container with infolist in one tab, other related tables in the other tabs
Ah, right. So in UserResource you should have access directly to $record. I'm using it like that in some of mine, eg:
Forms\Components\Textarea::make('errors')
->formatStateUsing(function ( $record ) {
return str_replace( ",", PHP_EOL, $record->errors );
})
92 replies
Tabbed container with infolist in one tab, other related tables in the other tabs
Do you have
->record($this->user)
in your Infolist declartion? https://filamentphp.com/docs/3.x/infolists/adding-an-infolist-to-a-livewire-component#passing-data-to-the-infolist92 replies
Tabbed container with infolist in one tab, other related tables in the other tabs
So you added the mount method to the
class ListAssets
file? Try removing mount and just doing public Model $record;
. But thinking about that, it just makes it available to the livewire component. I assume you want to pass it into the query?92 replies
Tabbed container with infolist in one tab, other related tables in the other tabs
And speaking of n00b, learning filament has been a humbling experience lol. I don't know where Livewire ends and Laravel begins, not to mention Alpine. I'm loving it now that I know it a lot better but I'm still trying to learn it much deeper.
92 replies