app/Models/Item.php: add getRouteKeyName()
This commit is contained in:
parent
3b71b0358b
commit
7df1e8345d
1 changed files with 10 additions and 0 deletions
|
|
@ -32,6 +32,16 @@ class Item extends Model
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the route key for the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRouteKeyName()
|
||||
{
|
||||
return 'slug';
|
||||
}
|
||||
|
||||
public function recipe()
|
||||
{
|
||||
return $this->belongsTo(Recipe::class, 'id');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue