From ab5181068d492d8f4d832ef7857d9b0dc85b9fb3 Mon Sep 17 00:00:00 2001 From: TimmensOne Date: Sun, 26 Mar 2023 11:32:54 +0200 Subject: [PATCH] add create device route --- device-app/app/Http/Controllers/DeviceController.php | 6 ++++++ device-app/resources/views/devices/create.blade.php | 5 +++++ device-app/resources/views/devices/index.blade.php | 1 + device-app/routes/web.php | 8 ++++++++ 4 files changed, 20 insertions(+) create mode 100644 device-app/resources/views/devices/create.blade.php diff --git a/device-app/app/Http/Controllers/DeviceController.php b/device-app/app/Http/Controllers/DeviceController.php index 9c01feb..e3a5f8a 100644 --- a/device-app/app/Http/Controllers/DeviceController.php +++ b/device-app/app/Http/Controllers/DeviceController.php @@ -15,6 +15,12 @@ public function index() ]); } + public function create(){ + return view('devices.create', [ + + ]); + } + public function show(Device $device) { return view('devices.show', [ diff --git a/device-app/resources/views/devices/create.blade.php b/device-app/resources/views/devices/create.blade.php new file mode 100644 index 0000000..f7c898f --- /dev/null +++ b/device-app/resources/views/devices/create.blade.php @@ -0,0 +1,5 @@ +@extends('layout') + +@section('content') +create +@endsection \ No newline at end of file diff --git a/device-app/resources/views/devices/index.blade.php b/device-app/resources/views/devices/index.blade.php index 0f076b0..cd6742f 100644 --- a/device-app/resources/views/devices/index.blade.php +++ b/device-app/resources/views/devices/index.blade.php @@ -11,4 +11,5 @@ @else

No devices found

@endunless + @endsection diff --git a/device-app/routes/web.php b/device-app/routes/web.php index 716a9fa..fcb2b37 100644 --- a/device-app/routes/web.php +++ b/device-app/routes/web.php @@ -19,6 +19,14 @@ 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 +// edit - show edit form +// update - update device +// destroy - delete device +// show - show sigle device Route::get('/devices/{device}', [DeviceController::class, 'show']);