add create device route
This commit is contained in:
parent
5baaa66885
commit
ab5181068d
@ -15,6 +15,12 @@ public function index()
|
||||
]);
|
||||
}
|
||||
|
||||
public function create(){
|
||||
return view('devices.create', [
|
||||
|
||||
]);
|
||||
}
|
||||
|
||||
public function show(Device $device)
|
||||
{
|
||||
return view('devices.show', [
|
||||
|
5
device-app/resources/views/devices/create.blade.php
Normal file
5
device-app/resources/views/devices/create.blade.php
Normal file
@ -0,0 +1,5 @@
|
||||
@extends('layout')
|
||||
|
||||
@section('content')
|
||||
create
|
||||
@endsection
|
@ -11,4 +11,5 @@
|
||||
@else
|
||||
<p>No devices found</p>
|
||||
@endunless
|
||||
<button><a href="devices/create">Device</a></button>
|
||||
@endsection
|
||||
|
@ -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']);
|
||||
|
Loading…
Reference in New Issue
Block a user