Access record after creation
How can I access or get the created record inside the
afterCreate()
hook? I need to do stuff after the creation but need the record id for it.
The handleRecordCreation()
doesn't really fit, because I do want to let that handling automatically (with relations etc.)
Thank you!2 Replies
Have you tried
$this->record
inside afterCreate()
? I believe that returns the created model.I haven't actually and it works. π
I tried $record as parameter first, but that didn't work.
Thank you!