i am new to laravel and filament...

so i need to remake an existing table into filament table. but for some reason it looks like this... here is the code for livewire file:
class WarehouseItemsTable extends Component implements HasTable, HasForms
{
    use InteractsWithTable;
    use InteractsWithForms;

    protected function getTableQuery(): Builder
    {
        return Item::query()->with(['type', 'unit', 'page']);
    }

    protected function getTableColumns(): array
    {
        return [
            TextColumn::make('name')->label('Názov')->searchable(),
            TextColumn::make('sku')->label('SKU'),
            TextColumn::make('upc')->label('UPC'),
            TextColumn::make('weight')->label('Váha'),
            TextColumn::make('type.name')->label('Typ'),
            TextColumn::make('unit.name')->label('Jednotka'),
        ];
    }

    public function render()
    {
        return view('livewire.warehouse-items-table');
    }
}


and here is the usage in blade file:
        <div class="card-body">
            @section('content')
                <div class="container mx-auto p-4">
                    <h1 class="text-2xl font-bold mb-4">Skladové položky</h1>
                    @livewire('warehouse-items-table')
                </div>
            @endsection
        </div>
image.png
Was this page helpful?