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 App\User;
|
||||
use App\Season;
|
||||
use Log;
|
||||
|
||||
class RegistrationController extends Controller
|
||||
{
|
||||
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');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,12 +27,14 @@
|
|||
@if (!Auth::check())
|
||||
<div>
|
||||
<a href="/login" class="btn btn-primary">Anmelden</a>
|
||||
</div>
|
||||
</div>
|
||||
<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
|
||||
</span>
|
||||
</section>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue