public function index()
 {
     $usersData = [];
     $usersData['count'] = User::all()->count();
     $usersData['incompleteCount'] = User::where('status', 0)->count();
     $picsData = [];
     $picsData['count'] = Pic::all()->count();
     $clubsData = [];
     $clubsData['count'] = Club::all()->count();
     $badgesData = [];
     $badgesData['count'] = Badge::all()->count();
     $fixtures = Fixture::all();
     $fixturesData = [];
     $fixturesData['count'] = $fixtures->count();
     $fixturesData['overCount'] = $fixtures->filter(function ($fxt) {
         return $fxt->isOver();
     })->count();
     $fixturesData['closedNotOverCount'] = $fixtures->filter(function ($fxt) {
         return $fxt->isClosed() and !$fxt->isOver();
     })->count();
     $gameweeks = Gameweek::all();
     $gameweeksData = [];
     $gameweeksData['count'] = $gameweeks->count();
     $gameweeksData['completeCount'] = Gameweek::complete()->get()->count();
     $gameweeksData['pendingCount'] = Gameweek::incomplete()->get()->filter(function ($gw) {
         return $gw->hasCompletedFixture();
     })->count();
     $adminsData = [];
     $adminsData['count'] = Admin::all()->count();
     return view('admin.dashboard.index', compact('usersData', 'picsData', 'clubsData', 'badgesData', 'fixturesData', 'gameweeksData', 'adminsData'));
 }
Exemplo n.º 2
0
 public function index()
 {
     $badges = \App\Badge::all();
     $nameOfPage = 'badges';
     if (\Auth::check()) {
         $user = \Auth::user();
         return view('badges.index', compact('badges', 'user', 'nameOfPage'));
     }
     return view('badges.index', compact('badges', 'nameOfPage'));
 }
Exemplo n.º 3
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $badges = Badge::all();
     return view('admin.badge.index', compact('badges'));
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     return Response::json(Badge::all());
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     return Badge::all();
 }