42 lines
1.2 KiB
PHP
42 lines
1.2 KiB
PHP
<?php
|
|
|
|
use App\Http\Controllers\DeviceController;
|
|
use Illuminate\Support\Facades\Route;
|
|
use App\Models\Device;
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| 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');
|
|
});
|
|
|
|
// index - show all devices
|
|
Route::get('/devices', [DeviceController::class, 'index']);
|
|
|
|
// create - show create form
|
|
Route::get('/devices/create', [DeviceController::class, 'create']);
|
|
|
|
// store - store new device
|
|
Route::post('/devices', [DeviceController::class, 'store']);
|
|
|
|
// edit - show edit form
|
|
Route::get('devices/{device}/edit', [DeviceController::class, 'edit']);
|
|
|
|
// update - update device
|
|
Route::put('devices/{device}', [DeviceController::class, 'update']);
|
|
|
|
// destroy - delete device
|
|
Route::delete('devices/{device}', [DeviceController::class, 'destroy']);
|
|
|
|
// show - show sigle device
|
|
Route::get('/devices/{device}', [DeviceController::class, 'show']);
|