my-projects-website/app/src/routes/web.php

31 lines
1.9 KiB
PHP
Raw Normal View History

<?php
use Illuminate\Support\Facades\Route;
Route::middleware('guest')->group(function () {
Route::get('login', [\App\Http\Controllers\AuthController::class, 'login'])->name('login');
Route::middleware(['throttle:login'])->post('login', [\App\Http\Controllers\AuthController::class, 'authorization'])->name('authorization');
});
Route::middleware(['auth', 'verified', \App\Http\Middleware\UserLocale::class])->group(function () {
Route::post('logout', [\App\Http\Controllers\AuthController::class, 'logout'])->name('logout');
Route::middleware([\App\Http\Middleware\AdminPanel::class])->prefix('admin')->as('admin.')->group(function () {
Route::get('/', [\App\Http\Controllers\Admin\DashboardController::class, 'index'])->name('home');
Route::resource('users', \App\Http\Controllers\Admin\UsersController::class)->only(['index', 'create', 'store', 'edit', 'update', 'destroy'])->where(['user' => '[0-9]+']);
Route::put('users/{id}/password', [\App\Http\Controllers\Admin\UsersController::class, 'updatePassword'])->name('users.update-password')->where(['id' => '[0-9]+']);
Route::resource('roles', \App\Http\Controllers\Admin\RolesController::class)->only(['index', 'create', 'store', 'edit', 'update', 'destroy'])->where(['role' => '[0-9]+']);
});
Route::prefix('profile')->as('profile.')->group(function () {
Route::get('/', [\App\Http\Controllers\Private\ProfileController::class, 'profile'])->name('edit');
Route::put('/', [\App\Http\Controllers\Private\ProfileController::class, 'update'])->name('update');
Route::put('password', [\App\Http\Controllers\Private\ProfileController::class, 'updatePassword'])->name('update-password');
Route::get('settings', [\App\Http\Controllers\Private\ProfileController::class, 'settings'])->name('settings');
Route::put('settings', [\App\Http\Controllers\Private\ProfileController::class, 'updateSettings'])->name('update-settings');
});
});