authenticationLog = $authenticationLog; $this->agent = new Agent(); $this->agent->setUserAgent($authenticationLog->user_agent); } public function via(mixed $notifiable) : array|string { return $notifiable->notifyAuthenticationLogVia(); } /** * Wrap the notification to a mail envelop */ public function toMail(mixed $notifiable) : MailMessage { return (new MailMessage()) ->subject(__('notifications.new_device.subject')) ->markdown('emails.newDevice', [ 'account' => $notifiable, 'time' => $this->authenticationLog->login_at, 'ipAddress' => $this->authenticationLog->ip_address, 'browser' => $this->agent->browser(), 'platform' => $this->agent->platform(), ]); } }