Example #1
0
 /**
  * @param QuizWasCreated $event
  */
 public function handle(QuizWasCreated $event)
 {
     $quiz = Quiz::find($event->quiz->id);
     $title = $quiz->name;
     $link = App::getLocale() . '/quiz/' . $quiz->id;
     $user = User::find($event->user->id);
     $username = $user->name;
     $this->mailer->compose($user->email, $username, $title, $link)->send();
 }
Example #2
0
 public function tags($slug)
 {
     $quizzes = Quiz::withAnyTag([$slug])->latest('published_at')->published()->paginate(8);
     $countUserQuizzes = $this->repository->countUserQuizzes();
     return view('Quiz.index', compact('quizzes', 'countUserQuizzes'));
 }