Added quota table and model.
This commit is contained in:
parent
2370c90170
commit
14698083f8
13275 changed files with 1397800 additions and 18 deletions
|
|
@ -4,6 +4,7 @@ namespace App\Http\Controllers;
|
|||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Season;
|
||||
use App\Quota;
|
||||
use DB;
|
||||
use Auth;
|
||||
use Log;
|
||||
|
|
@ -14,12 +15,17 @@ class SeasonsController extends Controller
|
|||
if (Auth::guest()) { return redirect("/"); }
|
||||
if (!Auth::user()->admin) { return redirect("/"); }
|
||||
|
||||
|
||||
|
||||
$seasons = DB::table('seasons')->get();
|
||||
$activeSeason=Season::getCurrent();
|
||||
|
||||
Log::info("Creating default quota");
|
||||
Quota::createDefaultQuota($activeSeason->id);
|
||||
|
||||
return view('seasons.index', compact('seasons','activeSeason'));
|
||||
}
|
||||
|
||||
|
||||
public function create() {
|
||||
if (Auth::guest()) { return redirect("/"); }
|
||||
if (!Auth::user()->admin) { return redirect("/"); }
|
||||
|
|
@ -52,7 +58,6 @@ class SeasonsController extends Controller
|
|||
return redirect('/seasons');
|
||||
}
|
||||
|
||||
|
||||
public function setcurrent($new_season_id) {
|
||||
if (Auth::guest()) { return redirect("/"); }
|
||||
if (!Auth::user()->admin) { return redirect("/"); }
|
||||
|
|
@ -61,4 +66,4 @@ class SeasonsController extends Controller
|
|||
return redirect("/seasons");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue