public function sortPosters($direction) { if (Request::ajax()) { $posters = Poster::orderBy('created_at', $direction)->get(); dd($posters); return View::make('posters/all_previews', array('posters' => $posters)); } }
/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { $objImgPoster = array(); $gamePoster = GamePoster::where('user_id', $id)->select('poster_id')->get(); if ($gamePoster->count() > 0) { foreach ($gamePoster as $value) { $find = Poster::where('poster_id', $value->poster_id)->select('image_default', 'poster_id')->get(); array_push($objImgPoster, $find[0]); } return response()->json($objImgPoster); } else { return "empty"; } }
/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { $Poster = Poster::Where('poster_id', $id)->get(); return response()->json($Poster); }