If no users exist redirect to /register from /login
If no users exist redirect to /register from /login
This commit is contained in:
parent
52a5c2427c
commit
6dfcaea04f
|
@ -4,6 +4,7 @@ namespace App\Http\Controllers\Auth;
|
|||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\Auth\LoginRequest;
|
||||
use App\Models\User;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
@ -17,6 +18,10 @@ class AuthenticatedSessionController extends Controller
|
|||
*/
|
||||
public function create()
|
||||
{
|
||||
$users = User::all();
|
||||
if ($users->count() === 0) {//Only allow 1 user for this app
|
||||
return redirect('/register');
|
||||
}
|
||||
return view('auth.login');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user