App\Http\Controllers\TournamentsController::unregister PHP Method

unregister() public method

public unregister ( $id )
    public function unregister($id)
    {
        $tournament = Tournament::findOrFail($id);
        if (!$tournament->isRegistrationOpen()) {
            return error_popup('registrations are closed!');
        }
        $tournament->unregister(Auth::user());
        return ujs_redirect("/tournaments/{$id}");
    }