F
Filament16mo ago
_max28

Customizing the creation process

Hi guys, could you tell me how I can insert the mandatory return without creating the record since the ApplyCashback Job that applies custom dynamics already does it?
protected function handleRecordCreation(array $data): Model
{
ApplyCashback::dispatch($data['userId'], $data['serviceId']); // Job with creating logic
return static::getModel()::create($data); // I don't need to create another record
}
protected function handleRecordCreation(array $data): Model
{
ApplyCashback::dispatch($data['userId'], $data['serviceId']); // Job with creating logic
return static::getModel()::create($data); // I don't need to create another record
}
8 Replies
krekas
krekas16mo ago
You need to return model
_max28
_max28OP16mo ago
How can I return the model without create a new record?
krekas
krekas16mo ago
Can't job return it?
_max28
_max28OP16mo ago
No it returns a boolean value
krekas
krekas16mo ago
Then create your own action
_max28
_max28OP16mo ago
any link to the doc?
krekas
krekas16mo ago
Actions section
_max28
_max28OP16mo ago
Thank you
Want results from more Discord servers?
Add your server