diff --git a/device-app/app/Http/Controllers/DeviceController.php b/device-app/app/Http/Controllers/DeviceController.php index 2a299f2..673ec71 100644 --- a/device-app/app/Http/Controllers/DeviceController.php +++ b/device-app/app/Http/Controllers/DeviceController.php @@ -37,6 +37,10 @@ public function store(Request $request){ return redirect('/devices'); } + public function edit(Device $device) { + return view('devices.edit', ['device' => $device]); + } + public function show(Device $device) { return view('devices.show', [ diff --git a/device-app/resources/views/devices/edit.blade.php b/device-app/resources/views/devices/edit.blade.php new file mode 100644 index 0000000..0acce54 --- /dev/null +++ b/device-app/resources/views/devices/edit.blade.php @@ -0,0 +1,57 @@ +@extends('layout') + +@section('content') +
+ @csrf + @method('PUT') + + + @error('device_id') +

{{$message}}

+ @enderror +
+ + + @error('device_id') +

{{$message}}

+ @enderror +
+ + + @error('device_id') +

{{$message}}

+ @enderror +
+ + + @error('device_id') +

{{$message}}

+ @enderror +
+ + + @error('device_id') +

{{$message}}

+ @enderror +
+ + + @error('device_id') +

{{$message}}

+ @enderror +
+ + + @error('device_id') +

{{$message}}

+ @enderror +
+ + + @error('device_id') +

{{$message}}

+ @enderror +
+ +
+@endsection \ No newline at end of file diff --git a/device-app/resources/views/devices/show.blade.php b/device-app/resources/views/devices/show.blade.php index dc468cd..b6713fe 100644 --- a/device-app/resources/views/devices/show.blade.php +++ b/device-app/resources/views/devices/show.blade.php @@ -12,4 +12,5 @@
  • {{ $device['serial_number'] }}
  • {{ $device['image_url'] }}
  • + @endsection diff --git a/device-app/routes/web.php b/device-app/routes/web.php index 905daee..471f73f 100644 --- a/device-app/routes/web.php +++ b/device-app/routes/web.php @@ -29,6 +29,8 @@ Route::post('/devices', [DeviceController::class, 'store']); // edit - show edit form +Route::get('devices/{device}/edit', [DeviceController::class, 'edit']); + // update - update device // destroy - delete device // show - show sigle device