add basic routes

This commit is contained in:
TimmensOne 2023-03-23 12:25:56 +01:00
parent 972cb882f9
commit ad30a02a52
5 changed files with 32 additions and 140 deletions

View File

@ -0,0 +1 @@
<h1>Device DEtail</h1>

View File

@ -0,0 +1,8 @@
<h1>Device List</h1>
@unless(count($devices) == 0)
@foreach($devices as $device)
@endforeach
@else
<p>No devices</p>
@endunless

File diff suppressed because one or more lines are too long

View File

@ -14,6 +14,19 @@
|
*/
Route::get('deviceList', function() {
return response()->json([
'devices' => [
[
'title' => 'Device One'
],
[
'title' => 'Device Two'
]
]
]);
});
Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
return $request->user();
});

View File

@ -1,5 +1,6 @@
<?php
use GuzzleHttp\Psr7\Request;
use Illuminate\Support\Facades\Route;
/*
@ -16,3 +17,11 @@
Route::get('/', function () {
return view('welcome');
});
Route::get('/devices', function () {
return view('deviceList');
});
Route::get('/devices/{id}', function ($id) {
return view('deviceDetail');
});