158 lines
10 KiB
PHP
158 lines
10 KiB
PHP
<?php
|
|
|
|
use App\Http\Controllers\Auth\LoginController;
|
|
use App\Http\Controllers\Cabel\CabelCategoryController;
|
|
use App\Http\Controllers\Cabel\CabelController;
|
|
use App\Http\Controllers\Loan\LoanController;
|
|
use App\Http\Controllers\Loan\NoteController;
|
|
use App\Http\Controllers\Loan\PdfController;
|
|
use App\Http\Controllers\Loan\ReservationController;
|
|
use App\Http\Controllers\OtherController;
|
|
use App\Http\Controllers\Product\BrandController;
|
|
use App\Http\Controllers\Product\ProductCategoryController;
|
|
use App\Http\Controllers\Product\ProductController;
|
|
use App\Http\Controllers\Product\ProductModelController;
|
|
use App\Http\Controllers\Product\ProductSubcategoryController;
|
|
use App\Http\Controllers\Rooms\BuildingController;
|
|
use App\Http\Controllers\Rooms\RoomController;
|
|
use App\Http\Controllers\User\RoleController;
|
|
use App\Http\Controllers\User\UserController;
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Web Routes
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Here is where you can register web routes for your application. These
|
|
| routes are loaded by the RouteServiceProvider within a group which
|
|
| contains the "web" middleware group. Now create something great!
|
|
|
|
|
*/
|
|
Route::get('/', function () {
|
|
return redirect()->route('login');
|
|
})->name('/');
|
|
|
|
//auth
|
|
Route::get('login', [LoginController::class, 'login'])->name('login');
|
|
Route::post('authenticate', [LoginController::class, 'authenticate'])->name('authenticate');
|
|
|
|
Route::middleware("auth:adUser,nadUser")->group(function () {
|
|
// Auth
|
|
Route::get('logout', [LoginController::class, 'logout'])->name('logout');
|
|
|
|
// Other Pages
|
|
Route::get('statistics', [OtherController::class, 'statistics'])->name('statistics')->middleware('can:statistics');
|
|
Route::get('logs', [OtherController::class, 'logs'])->name('logs')->middleware('can:logs_viewAny');
|
|
|
|
// Roles
|
|
Route::get('/roles/deleted', [RoleController::class,'deleted'])->name('roles.deleted');
|
|
Route::get('/roles/{role}/restore', [RoleController::class,'restore'])->name('roles.restore');
|
|
Route::get('/roles/{role}/forceDelete', [RoleController::class,'delete_force'])->name('roles.forceDelete');
|
|
|
|
// Users
|
|
Route::get('/users/deleted', [UserController::class,'deleted'])->name('users.deleted');
|
|
Route::get('/users/{user}/restore', [UserController::class,'restore'])->name('users.restore');
|
|
Route::get('/users/{user}/forceDelete', [UserController::class,'delete_force'])->name('users.forceDelete');
|
|
|
|
// Buildings
|
|
Route::get('/buildings/deleted', [BuildingController::class,'deleted'])->name('buildings.deleted');
|
|
Route::get('/buildings/{building}/restore', [BuildingController::class,'restore'])->name('buildings.restore');
|
|
Route::get('/buildings/{building}/forceDelete', [BuildingController::class,'delete_force'])->name('buildings.forceDelete');
|
|
|
|
// Rooms
|
|
Route::get('/rooms/deleted', [RoomController::class,'deleted'])->name('rooms.deleted');
|
|
Route::get('/rooms/{room}/restore', [RoomController::class,'restore'])->name('rooms.restore');
|
|
Route::get('/rooms/{room}/forceDelete', [RoomController::class,'delete_force'])->name('rooms.forceDelete');
|
|
|
|
// Categories
|
|
Route::get('/categories/deleted', [ProductCategoryController::class,'deleted'])->name('categories.deleted');
|
|
Route::get('/categories/{category}/restore', [ProductCategoryController::class,'restore'])->name('categories.restore');
|
|
Route::get('/categories/{category}/forceDelete', [ProductCategoryController::class,'delete_force'])->name('categories.forceDelete');
|
|
|
|
// Subcategories
|
|
Route::get('/subcategories/deleted', [ProductSubcategoryController::class,'deleted'])->name('subcategories.deleted');
|
|
Route::get('/subcategories/{subcategory}/restore', [ProductSubcategoryController::class,'restore'])->name('subcategories.restore');
|
|
Route::get('/subcategories/{subcategory}/forceDelete', [ProductSubcategoryController::class,'delete_force'])->name('subcategories.forceDelete');
|
|
|
|
// Brands
|
|
Route::get('/brands/deleted', [BrandController::class,'deleted'])->name('brands.deleted');
|
|
Route::get('/brands/{brand}/restore', [BrandController::class,'restore'])->name('brands.restore');
|
|
Route::get('/brands/{brand}/forceDelete', [BrandController::class,'delete_force'])->name('brands.forceDelete');
|
|
|
|
// Models
|
|
Route::get('/models/deleted', [ProductModelController::class,'deleted'])->name('models.deleted');
|
|
Route::get('/models/{model}/restore', [ProductModelController::class,'restore'])->name('models.restore');
|
|
Route::get('/models/{model}/forceDelete', [ProductModelController::class,'delete_force'])->name('models.forceDelete');
|
|
|
|
// Products
|
|
Route::get('/products/deleted', [ProductController::class,'deleted'])->name('products.deleted');
|
|
Route::get('/products/{product}/restore', [ProductController::class,'restore'])->name('products.restore');
|
|
Route::get('/products/{product}/forceDelete', [ProductController::class,'delete_force'])->name('products.forceDelete');
|
|
Route::put('/products/{product}/amount/add', [ProductController::class, 'amount_add'])->name('products.amount.add');
|
|
Route::put('/products/{product}/amount/remove', [ProductController::class, 'amount_remove'])->name('products.amount.remove');
|
|
|
|
// Cabels
|
|
Route::get('/cabelCategories/deleted', [CabelCategoryController::class,'deleted'])->name('cabelCategories.deleted');
|
|
Route::get('/cabelCategories/{cabelCategory}/restore', [CabelCategoryController::class,'restore'])->name('cabelCategories.restore');
|
|
Route::get('/cabelCategories/{cabelCategory}/forceDelete', [CabelCategoryController::class,'delete_force'])->name('cabelCategories.forceDelete');
|
|
|
|
// Cabels
|
|
Route::get('/cabels/deleted', [CabelController::class,'deleted'])->name('cabels.deleted');
|
|
Route::get('/cabels/{cabel}/restore', [CabelController::class,'restore'])->name('cabels.restore');
|
|
Route::get('/cabels/{cabel}/forceDelete', [CabelController::class,'delete_force'])->name('cabels.forceDelete');
|
|
Route::put('/cabels/{cabel}/amount/add', [CabelController::class, 'amount_add'])->name('cabels.amount.add');
|
|
Route::put('/cabels/{cabel}/amount/remove', [CabelController::class, 'amount_remove'])->name('cabels.amount.remove');
|
|
|
|
// Loans
|
|
Route::get('/loans', [LoanController::class,'index'])->name('loans.index');
|
|
Route::get('/loans/create', [LoanController::class,'create'])->name('loans.create');
|
|
Route::post('/loans', [LoanController::class,'store'])->name('loans.store');
|
|
Route::get('/loans/laptop', [LoanController::class,'laptop_create'])->name('loans.laptop.create');
|
|
Route::post('/loans/laptop', [LoanController::class,'laptop_store'])->name('loans.laptop.store');
|
|
Route::get('/loans/return', [LoanController::class,'return_page'])->name('loans.return.page');
|
|
Route::post('/loans/return', [LoanController::class,'return_action'])->name('loans.return.action');
|
|
Route::get('/loans/{loan}/adjust', [LoanController::class,'adjust_page'])->name('loans.adjust.page');
|
|
Route::put('/loans/{loan}/adjust', [LoanController::class,'adjust_action'])->name('loans.adjust.action');
|
|
|
|
// Reservations
|
|
Route::get('/reservations', [ReservationController::class,'index'])->name('reservations.index');
|
|
Route::get('/reservations/{reservation}/validate', [ReservationController::class,'validate_page'])->name('reservations.validate.page');
|
|
Route::post('/reservations/{reservation}/validate', [ReservationController::class,'validate_action'])->name('reservations.validate.action');
|
|
Route::delete('/reservations/{reservation}/validate', [ReservationController::class,'cancel'])->name('reservations.validate.cancel');
|
|
Route::get('/reservations/validations', [ReservationController::class,'validations'])->name('reservations.validations');
|
|
Route::get('/reservations/setups', [ReservationController::class,'setups'])->name('reservations.setups');
|
|
Route::post('/reservations/{reservation}/setup', [ReservationController::class,'setup'])->name('reservations.setup');
|
|
Route::get('/reservations/pickups', [ReservationController::class,'pickups'])->name('reservations.pickups');
|
|
Route::post('/reservations/{reservation}/pickup', [ReservationController::class,'pickup'])->name('reservations.pickup');
|
|
Route::get('/reservations/create', [ReservationController::class,'create'])->name('reservations.create');
|
|
Route::post('/reservations', [ReservationController::class,'store'])->name('reservations.store');
|
|
|
|
// Notes
|
|
Route::get('/notes', [NoteController::class,'index'])->name('notes.index');
|
|
Route::get('/notes/deleted', [NoteController::class,'deleted'])->name('notes.deleted');
|
|
Route::get('/notes/{note}/edit', [NoteController::class,'edit'])->name('notes.edit');
|
|
Route::put('/notes/{note}/edit', [NoteController::class,'update'])->name('notes.update');
|
|
Route::delete('/notes/{note}', [NoteController::class,'delete'])->name('notes.destroy');
|
|
Route::get('/notes/{note}/forceDelete', [NoteController::class,'delete_force'])->name('notes.forceDelete');
|
|
Route::get('/notes/{note}/restore', [NoteController::class,'restore'])->name('notes.restore');
|
|
|
|
// PDF
|
|
Route::get('/contracts', [PdfController::class, 'index'],)->name('contracts.index');
|
|
Route::get('/PDF/{user}/{type}/{timestamp}', [PdfController::class, 'show'],)->name('pdf.show');
|
|
Route::delete('/PDF/{user}/{type}/{timestamp}', [PdfController::class, 'destroy'],)->name('pdf.delete')->middleware('can:pdf_delete');
|
|
|
|
// Resources
|
|
Route::resource('brands', BrandController::class);
|
|
Route::resource('models', ProductModelController::class);
|
|
Route::resource('products', ProductController::class);
|
|
Route::resource('categories', ProductCategoryController::class);
|
|
Route::resource('subcategories', ProductSubcategoryController::class);
|
|
Route::resource('users', UserController::class);
|
|
Route::resource('rooms', RoomController::class);
|
|
Route::resource('buildings', BuildingController::class);
|
|
Route::resource('roles', RoleController::class);
|
|
Route::resource('cabelCategories', CabelCategoryController::class);
|
|
Route::resource('cabels', CabelController::class);
|
|
});
|