abschlussprojekt-device-man.../device-app/routes/web.php

60 lines
3.2 KiB
PHP
Raw Normal View History

2023-03-21 19:54:30 +01:00
<?php
2023-03-25 11:02:47 +01:00
use App\Http\Controllers\DeviceController;
2023-03-31 10:52:12 +02:00
use App\Http\Controllers\LocationTransactionController;
use App\Http\Controllers\OwnerTransactionController;
use App\Http\Controllers\PurchasingInformationController;
use App\Http\Controllers\UserController;
2023-03-21 19:54:30 +01:00
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 and all of them will
| be assigned to the "web" middleware group. Make something great!
|
*/
2023-03-31 10:52:12 +02:00
Route::get('/', function () {
return redirect('/home');
});
Route::get('/home', function () {
2023-03-21 19:54:30 +01:00
return view('welcome');
});
2023-03-23 12:25:56 +01:00
2023-03-31 10:52:12 +02:00
// Device purchasing routes
2023-03-31 17:17:09 +02:00
Route::get('/devices/{device}/purchasing/edit', [PurchasingInformationController::class, 'edit'])->middleware('auth');
Route::put('/devices/{device}/purchasing', [PurchasingInformationController::class, 'update'])->middleware('auth');
2023-03-31 10:52:12 +02:00
// Device location routes
2023-03-31 17:17:09 +02:00
Route::get('/devices/{device}/locations/create', [LocationTransactionController::class, 'create'])->middleware('auth');
Route::post('/devices/{device}/locations', [LocationTransactionController::class, 'store'])->middleware('auth');
Route::get('/devices/locations/{location}/edit', [LocationTransactionController::class, 'edit'])->middleware('auth');
Route::put('/devices/locations/{location}', [LocationTransactionController::class, 'update'])->middleware('auth');
Route::delete('/devices/locations/{location}', [LocationTransactionController::class, 'destroy'])->middleware('auth');
2023-03-31 10:52:12 +02:00
// Device owner routes
2023-03-31 17:17:09 +02:00
Route::get('/devices/{device}/owners/create', [OwnerTransactionController::class, 'create'])->middleware('auth');
Route::post('/devices/{device}/owners', [OwnerTransactionController::class, 'store'])->middleware('auth');
Route::get('/devices/owners/{owner}/edit', [OwnerTransactionController::class, 'edit'])->middleware('auth');
Route::put('/devices/owners/{owner}', [OwnerTransactionController::class, 'update'])->middleware('auth');
Route::delete('/devices/owners/{owner}', [OwnerTransactionController::class, 'destroy'])->middleware('auth');
2023-03-31 10:52:12 +02:00
2023-03-31 17:17:09 +02:00
// Devices routes
Route::get('/devices', [DeviceController::class, 'index'])->middleware('auth');
Route::get('/devices/create', [DeviceController::class, 'create'])->middleware('auth');
Route::post('/devices', [DeviceController::class, 'store'])->middleware('auth')->middleware('auth');
2023-03-27 16:16:47 +02:00
Route::get('devices/{device}/edit', [DeviceController::class, 'edit'])->middleware('auth');
Route::put('devices/{device}', [DeviceController::class, 'update'])->middleware('auth');
Route::delete('devices/{device}', [DeviceController::class, 'destroy'])->middleware('auth');
2023-03-31 17:17:09 +02:00
Route::get('/devices/{device}', [DeviceController::class, 'show'])->middleware('auth');
2023-03-31 10:52:12 +02:00
//User routes
Route::get('/register', [UserController::class, 'create']);
Route::post('/users', [UserController::class, 'store']);
2023-03-27 16:16:47 +02:00
Route::get('/login', [UserController::class, 'login'])->name('login');
Route::post('/users/authenticate', [UserController::class, 'authenticate']);
2023-03-31 10:52:12 +02:00
Route::post('/logout', [UserController::class, 'logout']);