F
Filament16mo ago
freekdz

$table->contentGrid()

hi please ->contentGrid() must be in ressource or in list page? because don't want to work for me i need specific syntaxe?
4 Replies
Patrick Boivin
Patrick Boivin16mo ago
I think it should go on the page class, in the table() method. Can you show the code you have tried? Oh, looks like it should work in the resource too...
freekdz
freekdzOP16mo ago
public static function table(Table $table): Table { return $table ->contentGrid([ 'md' => 2, 'xl' => 3, ]) ->columns([ TextColumn::make('code')->sortable() ->searchable(), ImageColumn::make('image') ->disk('public_uploads') ->label('Photo') ->width(100) ->height(100) ->defaultImageUrl(url('images/default-boardtypes.png')), TextColumn::make('region_name')->sortable() ->searchable() ->label('Region'), TextColumn::make('ville_name')->sortable() ->searchable() ->label('Ville - Commune') ->description(fn ($record) => ' ' . $record->commune_name .' ' ), TextColumn::make('adresse') ->searchable() ->label('Adresse'), TextColumn::make('type')->sortable() ->searchable() ->label('Type'), TextColumn::make('face')->sortable() ->label('Face') ->description(fn ($record) => ' ' . $record->libre .' ' ), ])
Aimée
Aimée16mo ago
If you add a random layout component such as Grid or Panel to it, even if it's empty, the contentGrid will then work
freekdz
freekdzOP16mo ago
I must do it inside the column ? thanks its work
Want results from more Discord servers?
Add your server