$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
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
freekdzOP2y 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ée2y 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
freekdzOP2y ago
I must do it inside the column ? thanks its work

Did you find this page helpful?