add basic routes
This commit is contained in:
parent
972cb882f9
commit
ad30a02a52
1
device-app/resources/views/deviceDetail.blade.php
Normal file
1
device-app/resources/views/deviceDetail.blade.php
Normal file
@ -0,0 +1 @@
|
|||||||
|
<h1>Device DEtail</h1>
|
8
device-app/resources/views/deviceList.blade.php
Normal file
8
device-app/resources/views/deviceList.blade.php
Normal 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
@ -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) {
|
Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
|
||||||
return $request->user();
|
return $request->user();
|
||||||
});
|
});
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use GuzzleHttp\Psr7\Request;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -16,3 +17,11 @@
|
|||||||
Route::get('/', function () {
|
Route::get('/', function () {
|
||||||
return view('welcome');
|
return view('welcome');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Route::get('/devices', function () {
|
||||||
|
return view('deviceList');
|
||||||
|
});
|
||||||
|
|
||||||
|
Route::get('/devices/{id}', function ($id) {
|
||||||
|
return view('deviceDetail');
|
||||||
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user