/**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $tracks = Track::all();
     if ($tracks) {
         return view('publictransport', compact('tracks'));
     } else {
         return view('publictransport');
     }
 }
Ejemplo n.º 2
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $tracks = Track::all();
     return view('list-tracks')->with('tracks', $tracks);
 }