add components button

This commit is contained in:
TimmensOne
2023-03-31 10:52:12 +02:00
parent 6894c2c3c5
commit 0e1de41203
10 changed files with 205 additions and 11 deletions

View File

@@ -1,6 +1,9 @@
<?php
use App\Http\Controllers\DeviceController;
use App\Http\Controllers\LocationTransactionController;
use App\Http\Controllers\OwnerTransactionController;
use App\Http\Controllers\PurchasingInformationController;
use App\Http\Controllers\UserController;
use Illuminate\Support\Facades\Route;
@@ -15,16 +18,43 @@ use Illuminate\Support\Facades\Route;
|
*/
Route::get('/', function () {
return redirect('/home');
});
Route::get('/home', function () {
return view('welcome');
});
// Devices routes
// index - show all devices
Route::get('/devices', [DeviceController::class, 'index']);
// create - show device create form
Route::get('/devices/create', [DeviceController::class, 'create'])->middleware('auth');
// store - store new device
Route::post('/devices', [DeviceController::class, 'store'])->middleware('auth');
// Device purchasing routes
//Route::get('/devices/{device}/purchasing/create', [PurchasingInformationController::class, 'create']);
//Route::post('/devices/{device}/purchasing', [PurchasingInformationController::class, 'store']);
Route::get('/devices/{device}/purchasing/edit', [PurchasingInformationController::class, 'edit']);
Route::put('/devices/{device}/purchasing', [PurchasingInformationController::class, 'update']);
//Route::delete('/devices/{device}/purchasing', [PurchasingInformationController::class, 'destroy']);
// Device location routes
Route::get('/devices/{device}/locations/create', [LocationTransactionController::class, 'create']);
Route::post('/devices/{device}/locations', [LocationTransactionController::class, 'store']);
Route::get('/devices/locations/{location}/edit', [LocationTransactionController::class, 'edit']);
Route::put('/devices/locations/{location}', [LocationTransactionController::class, 'update']);
Route::delete('/devices/locations/{location}', [LocationTransactionController::class, 'destroy']);
// Device owner routes
Route::get('/devices/{device}/owners/create', [OwnerTransactionController::class, 'create']);
Route::post('/devices/{device}/owners', [OwnerTransactionController::class, 'store']);
Route::get('/devices/owners/{owner}/edit', [OwnerTransactionController::class, 'edit']);
Route::put('/devices/owners/{owner}', [OwnerTransactionController::class, 'update']);
Route::delete('/devices/owners/{owner}', [OwnerTransactionController::class, 'destroy']);
//
// edit - show edit form
Route::get('devices/{device}/edit', [DeviceController::class, 'edit'])->middleware('auth');
// update - update device
@@ -34,6 +64,7 @@ Route::delete('devices/{device}', [DeviceController::class, 'destroy'])->middlew
// show - show sigle device
Route::get('/devices/{device}', [DeviceController::class, 'show']);
//User routes
// create - show register form
Route::get('/register', [UserController::class, 'create']);
// store - store new user
@@ -43,4 +74,4 @@ Route::get('/login', [UserController::class, 'login'])->name('login');
// authenticate - log in user
Route::post('/users/authenticate', [UserController::class, 'authenticate']);
// logout - log out user
Route::post('/logout', [UserController::class, 'logout']);
Route::post('/logout', [UserController::class, 'logout']);