Exemplo n.º 1
0
 public function UpdateThread(Threads\Thread $thread, $subject, $body, Member $author, $isQuestion, $laravelVersion, array $tagIds)
 {
     $thread->fill(['subject' => $subject, 'body' => $body, 'author_id' => $author->id, 'is_question' => $isQuestion, 'laravel_version' => $laravelVersion]);
     $thread->setTagsById($tagIds);
     $this->raise(new Threads\Events\ThreadUpdatedEvent($thread));
     return $thread;
 }
Exemplo n.º 2
0
 public function getThreadRepliesPaginated(Thread $thread, $perPage = 20)
 {
     return $thread->replies()->paginate($perPage);
 }
Exemplo n.º 3
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);
 }