No Registration if there are leagues present
This commit is contained in:
parent
3e6099a15e
commit
faf00dc0cb
2 changed files with 14 additions and 4 deletions
|
|
@ -5,12 +5,20 @@ namespace App\Http\Controllers;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
use App\User;
|
use App\User;
|
||||||
|
use App\Season;
|
||||||
use Log;
|
use Log;
|
||||||
|
|
||||||
class RegistrationController extends Controller
|
class RegistrationController extends Controller
|
||||||
{
|
{
|
||||||
public function create() {
|
public function create() {
|
||||||
|
|
||||||
|
$season=Season::getCurrent();
|
||||||
|
if ($season) {
|
||||||
|
if ( Season::hasStandardLeague() || Season::hasQualifications() ) {
|
||||||
|
// Redirect to the home page
|
||||||
|
return redirect()->home();
|
||||||
|
}
|
||||||
|
}
|
||||||
return view('registration.create');
|
return view('registration.create');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,12 +27,14 @@
|
||||||
@if (!Auth::check())
|
@if (!Auth::check())
|
||||||
<div>
|
<div>
|
||||||
<a href="/login" class="btn btn-primary">Anmelden</a>
|
<a href="/login" class="btn btn-primary">Anmelden</a>
|
||||||
</div>
|
</div>
|
||||||
<p> </p>
|
<p> </p>
|
||||||
<div>
|
|
||||||
<a href="/register" class="btn btn-primary">Registrieren</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
@if (!App\Season::hasQualifications() && !App\Season::hasStandardLeague())
|
||||||
|
<div>
|
||||||
|
<a href="/register" class="btn btn-primary">Registrieren</a>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
@endif
|
@endif
|
||||||
</span>
|
</span>
|
||||||
</section>
|
</section>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue