2023-03-21 19:54:30 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
Route::get('/devices', function () {
|
2023-03-23 21:50:31 +01:00
|
|
|
//return view('deviceList');
|
|
|
|
return view('deviceList', [
|
|
|
|
//'devices' => Device::all()
|
|
|
|
'devices' => Device::all()
|
|
|
|
]);
|
2023-03-23 12:25:56 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
Route::get('/devices/{id}', function ($id) {
|
2023-03-23 21:50:31 +01:00
|
|
|
return view('deviceDetail', [
|
|
|
|
'device' => Device::find($id)
|
|
|
|
]);
|
2023-03-23 12:25:56 +01:00
|
|
|
});
|