F
Filament4mo ago
flex

Output a list/table in Resource's view-page without any Model

Hello! I want to show a simple table in a resource's view-page. But it's not a relation and the data to show does not depend on a model. Is there an easy way to do it in Filament v3? Thank you!
2 Replies
Patrick1989
Patrick19894mo ago
i did this today I extended the "EditRecord" page with my own, and duplicated the original blade view and put it in my own resource directory:
class EditEducation extends EditRecord
{
protected static string $resource = EducationResource::class;

/**
* We need a custom view in order to execute some javascript on mount
* @var view-string
*/
protected static string $view = 'filament.resources.education-resource.edit-record';
class EditEducation extends EditRecord
{
protected static string $resource = EducationResource::class;

/**
* We need a custom view in order to execute some javascript on mount
* @var view-string
*/
protected static string $view = 'filament.resources.education-resource.edit-record';
You can create a new livewire table using the command php artisan livewire:table now in your edit-record view, just call the livewire table component:
<div>
@include('filament-panels::resources.pages.edit-record')
@livewire('tables.your', ['record' => $record])
</div>
<div>
@include('filament-panels::resources.pages.edit-record')
@livewire('tables.your', ['record' => $record])
</div>
and in your table component, just customize the query so it fits your needs @flex