F
Filament7mo ago
Aminne

Add a event in user after creation

class CreateUser extends CreateRecord
{
protected static string $resource = UserResource::class;

protected function getRedirectUrl(): string
{
return $this->getResource()::getUrl('index');
}

protected function afterCreate(User $record)
{
$record->delete();
}
class CreateUser extends CreateRecord
{
protected static string $resource = UserResource::class;

protected function getRedirectUrl(): string
{
return $this->getResource()::getUrl('index');
}

protected function afterCreate(User $record)
{
$record->delete();
}
2 Replies
Tetracyclic
Tetracyclic7mo ago
Hi @Aminne, what's the question?
Aminne
AminneOP7mo ago
I wanted to execute an event after creation. I resolved it by using an observer adding function boot in model.
Want results from more Discord servers?
Add your server