Retrieving created user instance

How can i retrieve a created model in CreateRecord lifecycle? for context, i wanna get the model id to generate relations data
3 Replies
toeknee
toeknee2y ago
with a closure calling $record. But it depends exactly where and what part of the lifecycle.
Dennis Koch
Dennis Koch2y ago
Check the lifecycle hooks. I think you should be able to access $this->record->id after saving https://filamentphp.com/docs/2.x/admin/resources/creating-records#lifecycle-hooks
Filament
Creating records - Resources - Admin Panel - Filament
The elegant TALL stack admin panel for Laravel artisans.
fikurimax
fikurimaxOP2y ago
ohhh maybe i'll try $this->record->id in afterCreate() thanks
Want results from more Discord servers?
Add your server