fix single device route
This commit is contained in:
parent
0d22d49119
commit
d81439a4f7
@ -23,4 +23,9 @@ propably MIT
|
|||||||
latest: 15.04.2023
|
latest: 15.04.2023
|
||||||
|
|
||||||
## About
|
## About
|
||||||
Laravel is a full feature framework
|
Laravel is a full feature framework
|
||||||
|
|
||||||
|
## Database setup
|
||||||
|
|
||||||
|
### Data seed
|
||||||
|
sail exec laravel.test php artisan migrate:refresh --seed
|
@ -7,6 +7,15 @@
|
|||||||
|
|
||||||
class Device extends Model
|
class Device extends Model
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Timestamps are disabled.
|
||||||
|
* @var boolean
|
||||||
|
*/
|
||||||
public $timestamps = false;
|
public $timestamps = false;
|
||||||
|
/**
|
||||||
|
* The primary key associated with the table Devices.
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $primaryKey = 'device_id';
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
}
|
}
|
@ -21,13 +21,12 @@
|
|||||||
Route::get('/devices', function () {
|
Route::get('/devices', function () {
|
||||||
//return view('deviceList');
|
//return view('deviceList');
|
||||||
return view('deviceList', [
|
return view('deviceList', [
|
||||||
//'devices' => Device::all()
|
|
||||||
'devices' => Device::all()
|
'devices' => Device::all()
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::get('/devices/{id}', function ($id) {
|
Route::get('/devices/{device_id}', function ($device_id) {
|
||||||
return view('deviceDetail', [
|
return view('deviceDetail', [
|
||||||
'device' => Device::find($id)
|
'device' => Device::find($device_id)
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user