28 lines
612 B
PHP
28 lines
612 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use Illuminate\Http\Request;
|
|
use App\Season;
|
|
use App\Round;
|
|
use DB;
|
|
|
|
class RoundsController extends Controller
|
|
{
|
|
public function index() {
|
|
$activeSeason=Season::getCurrent();
|
|
$rounds =null;
|
|
|
|
|
|
//$rounds=Round::all();
|
|
|
|
if ($activeSeason) {
|
|
$activeSeasonId = Season::getCurrent()->id;
|
|
$rounds = Round::all()->where('season_id', '=', $activeSeasonId);
|
|
}
|
|
|
|
return view('rounds.index', compact('rounds','activeSeason'));
|
|
//return view('rounds.index');
|
|
//return view ('welcome');
|
|
}
|
|
}
|