Render table component without a view

Is it possible to build a Filament table without a view file?

Tried using Blade render but getting error:
Using $this when not in object context
From inside <x-filament-tables::reorder.handle />

class ListExamples extends Component implements HasForms, HasTable
{
    use InteractsWithTable;
    use InteractsWithForms;

    public function table(Table $table): Table
    {
        return $table
            ->query(Example::query())
            ->columns([
                TextColumn::make('name'),
            ]);
    }

    public function render(): string
    {
        return Blade::render(<<<'BLADE'
<div>
    {{ $table }}
</div>
BLADE, ['table' => $this->table]);
    }
}
Solution
You can also just return the HTML:
    public function render()
    {
        return $this->table->toHtml();
    }
Was this page helpful?