Files
sogandAsghary.Project09/routes/auth.php
T
2026-08-22 11:11:28 -07:00

36 lines
1.1 KiB
PHP

<?php
use App\Http\Controllers\Auth\LoginController;
use App\Http\Controllers\Auth\LogoutController;
use App\Http\Controllers\Auth\RegisterController;
use Illuminate\Support\Facades\Route;
Route::prefix('auth')->name('auth.')->group(function (){
Route::middleware('guest')->group(function (){
Route::prefix('register')->name('register.')->controller(RegisterController::class)->group(function (){
Route::get('/','index')->name('index');
Route::post('/','post')->name('post');
});
Route::prefix('login')->name('login.')->controller(loginController::class)->group(function (){
Route::get('/','index')->name('index');
Route::post('/','post')->name('post');
});
Route::get('cities-by-province/{province}', function (\App\Models\Province $province) {
return $province->cities()->orderBy('name')->get(['id', 'name']);
})->name('cities-by-province');
});
Route::get('logout',[LogoutController::class,'index'])->middleware('auth')->name('logout');
});