tippspiel/pfosten/app/Http/Controllers/RoundsController.php

29 lines
612 B
PHP
Raw Normal View History

2017-06-20 08:43:36 +02:00
<?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');
}
}