how to mutateFormDataBeforeCreate inside simple resource?
Hello, i want to ask how to use mutateFormDataBeforeCreate inside simple resouce
because i try to add here
it doesn't work
Thank you
because i try to add here
it doesn't work
Thank you
use App\Filament\Resources\CashflowResource;
use Filament\Actions;
use Filament\Resources\Pages\ManageRecords;
class ManageCashflows extends ManageRecords
{
protected static string $resource = CashflowResource::class;
protected function getHeaderActions(): array
{
return [
Actions\CreateAction::make(),
];
}
protected function mutateFormDataBeforeCreate(array $data): array
{
$data['user_id'] = auth()->id();
return $data;
}
}