Esempio n. 1
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index(Request $request)
 {
     if ($request->ajax()) {
         $genres = Genre::all();
         return response()->json($genres);
     }
     return view('genero.index');
 }
Esempio n. 2
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function listing()
 {
     $genres = Genre::all();
     return response()->json($genres->toArray());
 }