Пример #1
0
 public function handle($request)
 {
     $thread = $this->threadRepository->getBySlug($request->slug);
     if (!$thread) {
         throw new EntityNotFoundException();
     }
     $replies = $this->replyRepository->getRepliesForThread($thread, $request->page, $request->repliesPerPage);
     return new ViewThreadResponse($thread, $replies);
 }
Пример #2
0
 public function handle($request)
 {
     $member = $this->memberRepository->getByName($request->name);
     if (!$member) {
         throw new MemberNotFoundException();
     }
     $threads = $this->threadRepository->getRecentByMember($member, 5);
     $replies = $this->replyRepository->getRecentByMember($member, 5);
     return new ViewProfileResponse($member, $threads, $replies);
 }
Пример #3
0
 public function handle($request)
 {
     $threads = $this->threadRepository->getPageByTagsAndStatus($request->tags, $request->status, $request->page, $request->threadsPerPage);
     return new ListThreadsResponse($threads);
 }
Пример #4
0
 public function handle($request)
 {
     $thread = Thread::register($request->member, $request->subject, $request->body, $request->isQuestion, $request->laravelVersion, $request->tagIds);
     $this->threadRepository->save($thread);
     return new PostThreadResponse($thread);
 }