feat(auth): disable public registration while keeping member login

This commit is contained in:
2026-02-13 08:15:45 +08:00
parent 7095be82d5
commit 5c3866446c
5 changed files with 24 additions and 9 deletions

View File

@@ -12,10 +12,12 @@ use App\Http\Controllers\Auth\VerifyEmailController;
use Illuminate\Support\Facades\Route;
Route::middleware('guest')->group(function () {
Route::get('register', [RegisteredUserController::class, 'create'])
->name('register');
if (config('auth.registration_enabled')) {
Route::get('register', [RegisteredUserController::class, 'create'])
->name('register');
Route::post('register', [RegisteredUserController::class, 'store']);
Route::post('register', [RegisteredUserController::class, 'store']);
}
Route::get('login', [AuthenticatedSessionController::class, 'create'])
->name('login');