toArray(); return view('content.home' , self::$data); } public function contact(){ if (Session::get('user_id') ) { $user = User::getUserInfo(); self::$data['user'] = $user; } return view('content.contact' , self::$data); } public function postContact(ContactRequest $request){ Message::save_msg($request); return redirect('contact'); } // // public function blog(){ // return view('content.blog' ,self::$data); // } public function content($url){ $contents = DB::table('contents') ->join('menus' , 'menus.id' , '=' , 'contents.menu_id') ->where('menus.url' , '=' , $url) ->get() ->toArray(); if (!$contents){ Abort(404); } else{ self::$data['contents'] = $contents; self::$data['title'] .= $contents[0]->mtitle; return view('content.content',self::$data); } } }