F
Filament2mo ago
Panda

How to edit resource properties on simple resource creation?

Hi, I'm trying to mutate the data before resource creation on a simple resource using the documented method but the method is not being called, also the create another button cannot be disabled in simple resource creation model.
3 Replies
Robin
Robin2mo ago
when using simple resource, a ManageXXX is also created, there's a getHeaderActions() function that returns an array of actions, by default a CreateAction is present, you can chain createAnother and mutateFormDataUsing like,
Actions\CreateAction::make()
->createAnother(false) // disables create another
->mutateFormDataUsing(function(array $data){
$data['...'] = '...'
return $data;
})
Actions\CreateAction::make()
->createAnother(false) // disables create another
->mutateFormDataUsing(function(array $data){
$data['...'] = '...'
return $data;
})
Panda
Panda2mo ago
Thanks, got it!
Want results from more Discord servers?
Add your server