Inheritance: extends Socieboy\Forum\Entities\Libs\BaseRepo
Ejemplo n.º 1
0
 /**
  * @param ReplyRepo $replyRepo
  */
 public function handle(ReplyRepo $replyRepo)
 {
     $reply = $replyRepo->findOrFail($this->reply_id);
     $reply->correct_answer = !$reply->correct_answer;
     $reply->save();
     if (config('forum.events.fire')) {
         event(new BestAnswer($reply));
     }
 }
Ejemplo n.º 2
0
 /**
  * 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));
     }
 }
Ejemplo n.º 4
0
 /**
  * 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));
     }
 }
 /**
  * @param ReplyRepo $replyRepo
  */
 public function handle(ReplyRepo $replyRepo)
 {
     $reply = $replyRepo->findOrFail($this->reply_id);
     $reply->correct_answer = !$reply->correct_answer;
     $reply->save();
 }
Ejemplo n.º 6
0
 /**
  * Execute the job.
  *
  * @param ReplyRepo $replyRepo
  *
  * @return void
  */
 public function handle(ReplyRepo $replyRepo)
 {
     $reply = $replyRepo->find($this->id);
     $reply->update($this->prepareData());
 }
Ejemplo n.º 7
0
 /**
  * Determine if the user is authorized to make this request.
  *
  * @param ReplyRepo $replyRepo
  * @return bool
  */
 public function authorize(ReplyRepo $replyRepo)
 {
     $reply_id = $this->route('reply_id');
     $reply = $replyRepo->findOrFail($reply_id);
     return $reply->user_id == auth()->user()->id;
 }