From ad30a02a526204b0d2ef34ca234aab855c369c80 Mon Sep 17 00:00:00 2001 From: TimmensOne Date: Thu, 23 Mar 2023 12:25:56 +0100 Subject: [PATCH] add basic routes --- .../resources/views/deviceDetail.blade.php | 1 + .../resources/views/deviceList.blade.php | 8 + device-app/resources/views/welcome.blade.php | 141 +----------------- device-app/routes/api.php | 13 ++ device-app/routes/web.php | 9 ++ 5 files changed, 32 insertions(+), 140 deletions(-) create mode 100644 device-app/resources/views/deviceDetail.blade.php create mode 100644 device-app/resources/views/deviceList.blade.php diff --git a/device-app/resources/views/deviceDetail.blade.php b/device-app/resources/views/deviceDetail.blade.php new file mode 100644 index 0000000..12655c9 --- /dev/null +++ b/device-app/resources/views/deviceDetail.blade.php @@ -0,0 +1 @@ +

Device DEtail

\ No newline at end of file diff --git a/device-app/resources/views/deviceList.blade.php b/device-app/resources/views/deviceList.blade.php new file mode 100644 index 0000000..798bf9a --- /dev/null +++ b/device-app/resources/views/deviceList.blade.php @@ -0,0 +1,8 @@ +

Device List

+@unless(count($devices) == 0) +@foreach($devices as $device) +@endforeach + +@else +

No devices

+@endunless diff --git a/device-app/resources/views/welcome.blade.php b/device-app/resources/views/welcome.blade.php index 0406510..f47aba5 100644 --- a/device-app/resources/views/welcome.blade.php +++ b/device-app/resources/views/welcome.blade.php @@ -1,140 +1 @@ - - - - - - - Laravel - - - - - - - - - -
- @if (Route::has('login')) -
- @auth - Home - @else - Log in - - @if (Route::has('register')) - Register - @endif - @endauth -
- @endif - - -
- - +

Welcome

\ No newline at end of file diff --git a/device-app/routes/api.php b/device-app/routes/api.php index 889937e..fa1c366 100644 --- a/device-app/routes/api.php +++ b/device-app/routes/api.php @@ -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(); }); diff --git a/device-app/routes/web.php b/device-app/routes/web.php index d259f33..ec2f31d 100644 --- a/device-app/routes/web.php +++ b/device-app/routes/web.php @@ -1,5 +1,6 @@