F
Filament17mo ago
Wannes

Custom Page

How can I add a filament table (I would actually need multiple) to my custom page? I made it with
php artisan make:filament-page -type custom
php artisan make:filament-page -type custom
3 Replies
bwurtz999
bwurtz99917mo ago
use class MyCustomClass extends Page implements Tables\Contracts\HasTable use Filament\Tables; and then your view would be
<x-filament::page>
<div>
{{ $this->table }}
</div>
</x-filament::page>
<x-filament::page>
<div>
{{ $this->table }}
</div>
</x-filament::page>
I'm not sure how you would do multiple tables though
class MyCustomClass extends Page implements Tables\Contracts\HasTable
{
use Tables\Concerns\InteractsWithTable;

protected static string $view = 'my-custom-view';

// ...
}
class MyCustomClass extends Page implements Tables\Contracts\HasTable
{
use Tables\Concerns\InteractsWithTable;

protected static string $view = 'my-custom-view';

// ...
}
set the table data using protected function getTableQuery(): Builder and set the columns using protected function getTableColumns(): array
Wannes
WannesOP17mo ago
Thanks! Would it perhaps be an idea to create a Widget for each table and show those? I'm new to filament, so still figuring everything out :p
bwurtz999
bwurtz99917mo ago
If you wanted to show multiple tables then yes that might be the best way to do that
Want results from more Discord servers?
Add your server