FilamentF
Filament3y ago
ico

Filament v3 Resource does not fill the Edit form

Hello i integrated the Filament package into a existing Laravel 10 project.
When i followed the guide for the panels i discovered that after i have created a Resource ( when i filled the logic for the Table ) it doesn't fill the Edit form with the selected record.
My table looks like this (from the docs and demo on github )
->columns([
    Tables\Columns\TextColumn::make('name'),
    Tables\Columns\TextColumn::make('defectCategory.weight'),
    Tables\Columns\TextColumn::make('')->label('Check type')
        ->description(fn (Defect $defect): string => $defect->qualityCheck)
])
->filters([
    //
])
->actions([
    EditAction::make(),
])
->emptyStateActions([
    CreateAction::make(),
]);


And my Edit page is almost blank
protected static string $resource = DefectResource::class;
protected function getHeaderActions(): array
{
    return [
        Actions\DeleteAction::make(),
    ];
}


Was looking around found some were doing with the ->record() method so i tried
EditAction::make()
    ->record(function ($record) {
        return Defect::find($record);
    }),

But didn't make a difference

So what do i need to do to fill my Edit form with the selected record ?
Was this page helpful?