/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // Find out how many registered trainers there are $totalTrainers = User::all()->count(); $totalTrainerCaptures = Capture::where('user_id', \Auth::user()->id)->count(); $totalGlobalCaptures = Capture::all()->count(); return view('pokecentre.index', compact('totalTrainers', 'totalTrainerCaptures', 'totalGlobalCaptures')); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // Find out how many registered users there are $totalTrainers = User::all()->count(); // How many captures the trainer who is logged in has made $totalTrainerCaptures = Capture::where('user_id', \Auth::user()->id)->count(); // How many captures were made by all trainers $totalGlobalCaptures = Capture::all()->count(); // Show the contents of the pokecentre using its view return view('pokecentre.index', compact('totalTrainers', 'totalTrainerCaptures', 'totalGlobalCaptures')); }