1
0
Fork 0

app/Models/Item.php: add getRouteKeyName()

This commit is contained in:
Henrik Hautakoski 2021-07-23 13:26:42 +02:00
parent 3b71b0358b
commit 7df1e8345d

View file

@ -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');