/** * Display the home page. * * @return Response */ public function index() { $teamResults = Team::orderBy('team_points', 'desc')->take(10)->get(); $matchDb = new Match(); $match = $matchDb->join('fantasy_club as home', 'fantasy_match.home_club_id', '=', 'home.club_id')->join('fantasy_club as guest', 'fantasy_match.guest_club_id', '=', 'guest.club_id')->select('home.club_name as home_name', 'guest.club_name as guest_name', 'match_date')->get(); return view('front.index')->with('teamResults', $teamResults)->with('j', $j = 1)->with('matches', $match); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // This gets all rows and all columns from the players table. // If you want to change this. You can select specific columns by passing an array of the column names in all() $teams = Team::orderBy('name', 'asc')->get(); return view('dashboard', compact('teams')); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index(Request $request) { $this->generateSessionValueIfNotExists(); $data['teams'] = []; $teams = Team::orderBy('name', 'asc')->get(); foreach ($teams as $team) { $isFavourite = Rating::where('session', '=', $_SESSION["session"])->where('team_id', '=', $team->id)->get(); if (count($isFavourite) > 0) { $team->isFavourite = true; } else { $team->isFavourite = false; } array_push($data['teams'], $team); } //$data['ratings'] = Rating::all(); $data['ratings'] = DB::select('select count(*) as votos, t.name as equipo, t.link as enlace, u.name as usuario from ratings as r join teams as t on r.team_id = t.id join users as u on t.user_id = u.id group by r.team_id order by votos desc, t.name asc'); //dd($data); $data['last_teams'] = Team::orderBy('id', 'desc')->limit(5)->get(); $data['users'] = User::all(); return view('welcome.welcome', $data); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $users = User::orderBy('firstname')->paginate(12); $teams = Team::orderBy('team_name')->get(); $roles = Role::orderBy('role_name')->get(); return view('cp.users.index', compact('users', 'teams', 'roles')); }
/** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { // Just return the view function. // If you want to add any data and pass it, just get the data and pass it as a second argument to view() $teams = Team::orderBy('name', 'asc')->get(); return view('matches.create', compact('teams')); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $teams = Team::orderBy('name', 'ASC')->get(); // To protect json vulnerability, prefix the response // with a special string, Angular will automatically // strip out it. return ")]}',\n" . json_encode($teams); }
public function index(Request $request) { //$userPlayers = UserPlayers::where('user_id', $request->user()->id)->get(); $userPlayers = $request->user()->userContractsPlayers; $players = new Players(); $club = new Club(); $match = $request->user()->userPlayers; $teamResults = Team::orderBy('team_points', 'desc')->take(10)->get(); return view('front.team_player_list')->with('userPlayers', $userPlayers)->with('players', $players)->with('club', $club)->with('i', $i = 1)->with('match', $match)->with('team', $request->user()->team)->with('teamResults', $teamResults)->with('j', $j = 1); }
public function pagination($id) { $url_actual = "http://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]; $url_actual = explode('?', $url_actual); if ($id != 0) { $pag = Team::where('challenge_id', $id)->orderBy('id', 'desc')->paginate(env('PAG')); } else { $pag = Team::orderBy('id', 'desc')->paginate(env('PAG')); } $pag->setPath($url_actual[0]); return $pag; }
public function playQuiz($quizid) { $quiz = Quiz::find($quizid); $teams = Team::orderBy('name')->get(); $tables = array(); if ($quiz->teams) { foreach (json_decode($quiz->teams) as $key => $value) { $tables[$key] = $value; } } $questionAnswered = Question::where('quiz', $quizid)->where('tableid_score', '>', 0)->first(); $questionsAnswered = count($questionAnswered) ? true : false; return view('quiz')->with(['quiz' => $quiz, 'teams' => $teams, 'tables' => $tables, 'questionsAnswered' => $questionsAnswered]); }
public function index() { $teamResults = Team::orderBy('team_points', 'desc')->paginate(20); return view('front.results')->with('teamResults', $teamResults)->with('j', $j = 1); }
public function ShowTeams() { $data = Team::orderBy('id', 'desc')->paginate(10); return view('admin/equipo', ['teams' => $data]); }
/** * Display a listing of the team. * * @return Response view with listing of teams */ public function index() { $teams = Team::orderBy('created_at', 'desc')->paginate(10); return view('/teams/teams', ['teams' => $teams]); }
/** * Groups List view * * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ public function groups() { $teams = Team::orderBy('group', 'asc')->get(); return view('teams.groups', ['teams' => $teams]); }
public function index() { return view('team.index', ['teams' => Team::orderBy('title')->get()]); }
public function index($error = null) { $teamResults = Team::orderBy('team_points', 'desc')->take(10)->get(); return view('front.create_team', ['error' => $error])->with('teamResults', $teamResults)->with('j', $j = 1); }