/** * スレッド詳細表示アクション * @return Ambigous <\Illuminate\Http\RedirectResponse, \Illuminate\Http\RedirectResponse>|Ambigous <\Illuminate\View\View, mixed, \Illuminate\Container\static> */ public function thread() { //スレッドIDを取得 if (Input::has('id')) { $thread_id = Input::get('id'); } else { return redirect('/')->with('err_msg', 'スレッドが選択されていません'); } //スレッドID→スレッド名 $thread = Thread::getThreadName($thread_id); //スレッドID→投稿一覧 $comments = Comment::select('id', 'user', 'content', 'date', 'number', 'response', 'file')->where('thread_id', '=', $thread_id)->orderBy('response', 'ASC')->get(); //飲み屋取得 $shops = Tavern::getTarern($thread_id); return view('board.thread', compact('thread_id', 'thread', 'comments', 'shops')); }