コード例 #1
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $artists = Artist::get()->all();
     $artists = Artist::paginate(15);
     return view('artists.index', compact('artists'));
     //compact hace un arreglo
 }
コード例 #2
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     if (Auth::check()) {
         if (Auth::user()->is_admin) {
             $artists = \App\Artist::paginate(5);
             return view('cantantes.index', compact('artists'));
         }
         return redirect('inicio');
     } else {
         return redirect(url());
     }
 }
コード例 #3
0
ファイル: ArtistsController.php プロジェクト: edele/mudb
 public function index(Request $request)
 {
     $artists = Artist::paginate();
     return $artists;
 }