how render a table inside a tab?
hi i would like to load a table inside a tab like image attached, but that table should lookup info depending on the selected user id. i know i need to create a livewire custom component, but any idea to follow? and also another question how i call that livewire component inside lets say Tab #2. any tip appreciate it. thank you
23 Replies
1 - Create a LW component and add the table:
https://filamentphp.com/docs/3.x/tables/adding-a-table-to-a-livewire-component
2 - Insert the LW component
thank you, im getting this Class "App\Filament\Resources\Livewire" not found
import livewire namespace
how? im already using namespace App\Filament\Resources; inside
namespace App\Filament\Resources;
namespace App\Livewire; if i put this i got error
you could create a relation manager
and then
unless you want to use the table shown on the image
yes should be almost the same, the idea is for me to see invoices from that selected client without going to another menu item
then that example would work
if you have declared on the model the relations correctly
and why not the custom lw component?
well you can always go with the custom, i just thought that if you are building a fillament app you would want to use already built tools
\Filament\Forms\Components\Livewire::make(YourCustomTable::class)
actuallyand how i put that relation inside a tab?
Tabs\Tab::make('Tab 2')
->schema([
\Filament\Forms\Components\Livewire::make(ClientesFacturas::class)
]), like this?
do you know how the relation manager works? if you dont it uses the model relation like HasMany, HasOne, BelongsTo
and others
and then it returns the table of relations
yep
here, it will explain better than me
Unable to find component: [App\Filament\Resources\ClientesFacturas]
i got my class inside app/filament/livewire/
ty. will try both ways to see which fits in my case, thank you
Did you create this LW component
ClientesFacturas
?yes
Solution
works good thank you so much
Maybe do some research about namespaces