fix single device route
This commit is contained in:
parent
0d22d49119
commit
d81439a4f7
@ -24,3 +24,8 @@ latest: 15.04.2023
|
||||
|
||||
## About
|
||||
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
|
||||
{
|
||||
/**
|
||||
* Timestamps are disabled.
|
||||
* @var boolean
|
||||
*/
|
||||
public $timestamps = false;
|
||||
/**
|
||||
* The primary key associated with the table Devices.
|
||||
* @var string
|
||||
*/
|
||||
protected $primaryKey = 'device_id';
|
||||
use HasFactory;
|
||||
}
|
@ -21,13 +21,12 @@
|
||||
Route::get('/devices', function () {
|
||||
//return view('deviceList');
|
||||
return view('deviceList', [
|
||||
//'devices' => Device::all()
|
||||
'devices' => Device::all()
|
||||
]);
|
||||
});
|
||||
|
||||
Route::get('/devices/{id}', function ($id) {
|
||||
Route::get('/devices/{device_id}', function ($device_id) {
|
||||
return view('deviceDetail', [
|
||||
'device' => Device::find($id)
|
||||
'device' => Device::find($device_id)
|
||||
]);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user