/** * Display a conversation and replies * * @param $slug * @return \Illuminate\View\View */ public function show($slug) { $conversation = $this->conversationRepo->findBySlug($slug); $topic = Topic::all(); $replies = $conversation->replies()->orderBy('created_at', 'DESC')->paginate(4); return view('Forum::Conversations.show', compact('conversation', 'replies', 'topic')); }
/** * Execute the job. * * @param ConversationRepo $conversationRepo * * @return void */ public function handle(ConversationRepo $conversationRepo) { $conversation = $conversationRepo->model(); $conversation->fill($this->prepareDate()); $conversation->save(); if (config('forum.events.fire')) { event(new NewConversation($conversation)); } }
/** * Search * * @param Request $request * @return \Illuminate\View\View */ public function search(Request $request) { $conversations = $this->conversationRepo->search($request->all()); return view('Forum::index', compact('conversations')); }
/** * Execute the job. * * @param ConversationRepo $conversationRepo * * @return void */ public function handle(ConversationRepo $conversationRepo) { $conversation = $conversationRepo->findBySlug($this->slug); $conversation->update($this->prepareData()); }
/** * Execute the job. * * @param ConversationRepo $conversationRepo * @return void */ public function handle(ConversationRepo $conversationRepo) { $conversation = $conversationRepo->model(); $conversation->fill($this->prepareDate()); $conversation->save(); }
/** * Display the conversation edit form. * * @param string $slug * * @return \Illuminate\View\View */ public function edit($slug) { $conversation = $this->conversationRepo->findBySlug($slug); return view('Forum::Conversations.edit')->with(compact('conversation')); }