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

60 lines
4.6 KiB
PHP
Raw Permalink 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]+']);
2024-04-11 19:43:01 +05:00
Route::resource('projects', \App\Http\Controllers\Admin\ProjectsController::class)->where(['project' => '[0-9]+']);
Route::prefix('projects/{project}')->as('projects.')->group(function () {
Route::get('about', [\App\Http\Controllers\Admin\Projects\AboutController::class, 'languages'])->name('about.languages');
Route::get('about/{language}', [\App\Http\Controllers\Admin\Projects\AboutController::class, 'edit'])->name('about.edit')->where(['language' => '[0-9]+']);
Route::put('about/{language}', [\App\Http\Controllers\Admin\Projects\AboutController::class, 'update'])->name('about.update')->where(['language' => '[0-9]+']);
Route::resource('links', \App\Http\Controllers\Admin\Projects\LinksController::class)->except(['show'])->where(['link' => '[0-9]+']);
Route::get('translations', [\App\Http\Controllers\Admin\Projects\TranslationsController::class, 'languages'])->name('translations.languages');
Route::get('translations/{language}', [\App\Http\Controllers\Admin\Projects\TranslationsController::class, 'edit'])->name('translations.edit')->where(['language' => '[0-9]+']);
Route::post('translations/{language}', [\App\Http\Controllers\Admin\Projects\TranslationsController::class, 'update'])->name('translations.update')->where(['language' => '[0-9]+']);
2024-04-23 19:30:56 +05:00
Route::get('feedbacks', [\App\Http\Controllers\Admin\Projects\FeedbacksController::class, 'project'])->name('feedbacks.index');
Route::resource('documentation-versions', \App\Http\Controllers\Admin\Projects\DocumentationVersionController::class)->where(['documentation_version' => '[0-9]+']);
Route::prefix('documentation-versions/{version}')->as('documentation-versions.')->group(function () {
Route::resource('documentations', \App\Http\Controllers\Admin\Projects\DocumentationsController::class)->except(['show'])->where(['documentation' => '[0-9]+']);
Route::resource('categories', \App\Http\Controllers\Admin\Projects\DocumentationCategoriesController::class)->except(['show'])->where(['category' => '[0-9]+']);
})->where(['version' => '[0-9]+']);
})->where(['project' => '[0-9]+']);
2024-04-11 19:43:01 +05:00
2024-04-23 19:30:56 +05:00
Route::get('feedbacks', [\App\Http\Controllers\Admin\Projects\FeedbacksController::class, 'index'])->name('feedbacks.index');
2024-04-11 19:43:01 +05:00
Route::post('languages/new-language', [\App\Http\Controllers\Admin\LanguagesController::class, 'newLanguage'])->name('new-language');
});
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');
});
2024-04-11 19:43:01 +05:00
Route::prefix('storage')->as('storage.')->group(function () {
Route::post('image/upload-resize', [\App\Http\Controllers\Storage\ImagesController::class, 'uploadAndResize'])->name('image_upload_and_resize');
});
});