how to mutateFormDataBeforeCreate inside simple resource?

Hello, i want to ask how to use mutateFormDataBeforeCreate inside simple resouce

because i try to add here
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;
    }
}


it doesn't work

Thank you
Solution
Check the same docs. It’s mentioned there
Was this page helpful?