76 lines
2.6 KiB
PHP
76 lines
2.6 KiB
PHP
<?php
|
|
|
|
use App\Http\Controllers\AuthController;
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
// Публичные маршруты
|
|
Route::middleware('guest')->group(function () {
|
|
Route::get('/login', function () {
|
|
return Inertia('Auth/Login');
|
|
})->name('login');
|
|
|
|
Route::prefix('auth')->group(function () {
|
|
Route::post('/login', [AuthController::class, 'login']);
|
|
});
|
|
});
|
|
|
|
Route::prefix('api')->group(function () {
|
|
Route::get('/auth/login', [\App\Http\Controllers\Api\AuthController::class, 'login']);
|
|
});
|
|
|
|
Route::prefix('admin')->group(function () {
|
|
Route::get('/', [\App\Http\Controllers\Web\Admin\AdminController::class, 'index']);
|
|
|
|
Route::prefix('users')->group(function () {
|
|
Route::get('/', [\App\Http\Controllers\Web\Admin\UserController::class, 'index']);
|
|
Route::get('/new', [\App\Http\Controllers\Web\Admin\UserController::class, 'create']);
|
|
Route::post('/new', [\App\Http\Controllers\Web\Admin\UserController::class, 'store']);
|
|
Route::prefix('{user}')->group(function () {
|
|
Route::get('/', [\App\Http\Controllers\Web\Admin\UserController::class, 'show']);
|
|
});
|
|
});
|
|
});
|
|
|
|
Route::prefix('statistic')->group(function () {
|
|
Route::get('/', [\App\Http\Controllers\Web\StatisticController::class, 'index']);
|
|
Route::get('/report', [\App\Http\Controllers\Web\StatisticController::class, 'report']);
|
|
})->middleware(['auth']);
|
|
|
|
Route::get('/logout', [\App\Http\Controllers\AuthController::class, 'logout'])
|
|
->middleware(['auth'])
|
|
->name('logout');
|
|
|
|
Route::get('/dashboard', [\App\Http\Controllers\Web\IndexController::class, 'index'])
|
|
->middleware(['auth'])
|
|
->name('dashboard');
|
|
Route::get('/report', [\App\Http\Controllers\Web\ReportController::class, 'index'])
|
|
->middleware(['auth'])
|
|
->name('report');
|
|
Route::post('/report', [\App\Http\Controllers\Web\ReportController::class, 'store'])
|
|
->middleware(['auth'])
|
|
->name('report.store');
|
|
|
|
|
|
Route::post('/user/role/change', [\App\Http\Controllers\AuthController::class, 'changeRole'])
|
|
->middleware(['auth'])
|
|
->name('user.role.change');
|
|
|
|
Route::get('/path/patient', function () {
|
|
return \Inertia\Inertia::render('Path/Patient');
|
|
})
|
|
->middleware(['auth'])
|
|
->name('path.patient');
|
|
|
|
Route::get('/', [\App\Http\Controllers\Web\IndexController::class, 'start'])
|
|
->middleware(['auth'])
|
|
->name('start');
|
|
|
|
Route::get('/test-session', function (\Illuminate\Http\Request $request) {
|
|
return [
|
|
'session_id' => session()->getId(),
|
|
'user' => $request->user(),
|
|
'auth_check' => Auth::check(),
|
|
'cookies' => $request->cookies->all(),
|
|
];
|
|
});
|