add create device route

This commit is contained in:
TimmensOne 2023-03-26 11:32:54 +02:00
parent 5baaa66885
commit ab5181068d
4 changed files with 20 additions and 0 deletions

View File

@ -15,6 +15,12 @@ public function index()
]); ]);
} }
public function create(){
return view('devices.create', [
]);
}
public function show(Device $device) public function show(Device $device)
{ {
return view('devices.show', [ return view('devices.show', [

View File

@ -0,0 +1,5 @@
@extends('layout')
@section('content')
create
@endsection

View File

@ -11,4 +11,5 @@
@else @else
<p>No devices found</p> <p>No devices found</p>
@endunless @endunless
<button><a href="devices/create">Device</a></button>
@endsection @endsection

View File

@ -19,6 +19,14 @@
return view('welcome'); return view('welcome');
}); });
// index - show all devices
Route::get('/devices', [DeviceController::class, 'index']); 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']); Route::get('/devices/{device}', [DeviceController::class, 'show']);