$status, 'properties' => $props, ]); $log->user()->associate($event->user); $log->save(); } public function handleLogin(Login $event): void { $this->handleEvent(Status::LoginSuccess, $event); } public function handleFailed(Failed $event): void { $creds = collect($event->credentials)->except('password'); $this->handleEvent(Status::LoginFailure, $event, $creds); } public function handleLogout(Logout $event): void { $this->handleEvent(Status::Logout, $event); } public function subscribe(Dispatcher $events): array { return [ Login::class => 'handleLogin', Failed::class => 'handleFailed', Logout::class => 'handleLogout', ]; } }