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

42 lines
1.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-21 19:54:30 +01:00
use Illuminate\Support\Facades\Route;
2023-03-23 21:50:31 +01:00
use App\Models\Device;
2023-03-21 19:54:30 +01:00
/*
|--------------------------------------------------------------------------
| 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!
|
*/
Route::get('/', function () {
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-23 12:25:56 +01:00
2023-03-26 11:32:54 +02:00
// create - show create form
Route::get('/devices/create', [DeviceController::class, 'create']);
2023-03-26 12:17:43 +02:00
2023-03-26 11:32:54 +02:00
// 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']);