F
Filament16mo ago
lpoems

Why mutateFormDataBeforeCreate() doesn't work

protected function mutateFormDataBeforeCreate(array $data): array { $private = RSA::createKey(2048); $data['private_key'] = (string)$private; $data['public_key'] = (string)$private->getPublicKey(); //ddd($data); return $data; } After I click the button 'create', I found that the field 'private_key' 'public_key' in the newest record is still null. However, the ddd($data) works when I uncommented it.
Solution:
Maybe they are not in the $fillable array of the Model?
Jump to solution
1 Reply
Solution
Povilas K
Povilas K16mo ago
Maybe they are not in the $fillable array of the Model?
Want results from more Discord servers?
Add your server