Socieboy\Forum\Jobs\Replies\PostReply::handle PHP Method

handle() public method

Execute the job.
public handle ( ReplyRepo $replyRepo, Illuminate\Mail\Mailer $mailer ) : void
$replyRepo Socieboy\Forum\Entities\Replies\ReplyRepo
$mailer Illuminate\Mail\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.events.fire')) {
            event(new NewReply($reply));
        }
    }