26 lines
819 B
PHP
26 lines
819 B
PHP
<?php
|
|
|
|
use Illuminate\Support\Facades\Route;
|
|
use App\Http\Controllers\Admin\AuthController;
|
|
|
|
// Гость → форма входа
|
|
Route::get('/admin/login', [AuthController::class, 'showLoginForm'])->name('admin.login.form');
|
|
Route::post('/admin/login', [AuthController::class, 'login'])->name('admin.login');
|
|
|
|
// Авторизованный → админка
|
|
Route::middleware('auth')->prefix('admin')->group(function () {
|
|
Route::get('/hotels', function () {
|
|
return '<h1>Отели</h1><a href="/admin/logout">Выйти</a>';
|
|
})->name('admin.hotels.index');
|
|
|
|
Route::post('/logout', [AuthController::class, 'logout'])->name('admin.logout');
|
|
});
|
|
|
|
Route::get('/', function () {
|
|
return view('welcome');
|
|
});
|
|
|
|
Route::get('/{any?}', function () {
|
|
return view('app');
|
|
})->where('any', '.*');
|