/** * 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'); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function listing() { $genres = Genre::all(); return response()->json($genres->toArray()); }