exportJob = $exportJob->withoutRelations(); $this->afterCommit(); } /** * Get the notification's delivery channels. * * @return array */ public function via() { return ['mail']; } /** * Get the mail representation of the notification. * * @param User $user * @return \Illuminate\Notifications\Messages\MailMessage */ public function toMail(User $user): MailMessage { $date = Carbon::parse($this->exportJob->created_at) ->setTimezone($user->timezone); return (new MailMessage) ->success() ->subject(trans('mail.export_title')) ->greeting(trans('mail.greetings', ['username' => $user->first_name])) ->line(trans('mail.export_description', ['date' => DateHelper::getShortDate($date)])) ->action(trans('mail.export_download'), route('settings.export.index')); } }