/** * Execute the job. * * @param ReplyRepo $replyRepo * @param Mailer $mailer * @return void */ public function handle(ReplyRepo $replyRepo, Mailer $mailer) { $reply = $replyRepo->model(); $reply->fill($this->prepareData()); $reply->save(); if (config('config.forum.emails.fire')) { $this->sendEmail($mailer, $reply); } }
/** * Execute the job. * * @param ReplyRepo $replyRepo * @param Mailer $mailer * @return void */ public function handle(ReplyRepo $replyRepo, Mailer $mailer) { $reply = $replyRepo->model(); $reply->fill($this->prepareData()); $reply->save(); if (config('forum.emails.fire') && auth()->user()->id != $reply->user_id) { $this->sendEmail($mailer, $reply); } if (config('forum.broadcasting') && auth()->user()->id != $reply->user_id) { event(new NewReply($reply)); } }
/** * Execute the job. * * @param ReplyRepo $replyRepo * @param Mailer $mailer * * @return void */ public function handle(ReplyRepo $replyRepo, Mailer $mailer) { $reply = $replyRepo->model(); $reply->fill($this->prepareData()); $reply->save(); if (config('forum.emails.fire') && !$this->authUserIsOwner($reply->conversation)) { $this->sendEmail($mailer, $reply); } if (config('forum.broadcasting') && !$this->authUserIsOwner($reply->conversation)) { event(new NewReply($reply)); } }