2023-03-21 19:54:30 +01:00
|
|
|
<?php
|
|
|
|
|
2023-03-25 11:02:47 +01:00
|
|
|
use App\Http\Controllers\DeviceController;
|
2023-03-27 15:29:49 +02:00
|
|
|
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-27 15:29:49 +02:00
|
|
|
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-26 11:32:54 +02:00
|
|
|
// index - show all devices
|
2023-03-25 11:02:47 +01:00
|
|
|
Route::get('/devices', [DeviceController::class, 'index']);
|
2023-03-27 15:29:49 +02:00
|
|
|
// create - show device create form
|
2023-03-26 11:32:54 +02:00
|
|
|
Route::get('/devices/create', [DeviceController::class, 'create']);
|
|
|
|
// store - store new device
|
2023-03-26 12:17:43 +02:00
|
|
|
Route::post('/devices', [DeviceController::class, 'store']);
|
2023-03-26 11:32:54 +02:00
|
|
|
// edit - show edit form
|
2023-03-26 17:36:20 +02:00
|
|
|
Route::get('devices/{device}/edit', [DeviceController::class, 'edit']);
|
2023-03-26 11:32:54 +02:00
|
|
|
// update - update device
|
2023-03-26 18:16:26 +02:00
|
|
|
Route::put('devices/{device}', [DeviceController::class, 'update']);
|
2023-03-26 11:32:54 +02:00
|
|
|
// destroy - delete device
|
2023-03-26 18:16:26 +02:00
|
|
|
Route::delete('devices/{device}', [DeviceController::class, 'destroy']);
|
2023-03-26 11:32:54 +02:00
|
|
|
// show - show sigle device
|
2023-03-25 11:02:47 +01:00
|
|
|
Route::get('/devices/{device}', [DeviceController::class, 'show']);
|
2023-03-27 15:29:49 +02:00
|
|
|
|
|
|
|
// create - show register form
|
|
|
|
Route::get('/register', [UserController::class, 'create']);
|
|
|
|
// store - store new user
|
|
|
|
Route::post('/users', [UserController::class, 'store']);
|
|
|
|
// login - show user login form
|
|
|
|
Route::get('/login', [UserController::class, 'login']);
|
|
|
|
// authenticate - log in user
|
|
|
|
Route::post('/users/authenticate', [UserController::class, 'authenticate']);
|