If you would like model binding to use a default database column other than id
when retrieving a given model class, you may override the getRouteKeyName
method on the Eloquent model:
/**
* Get the route key for the model.
*
* @return string
*/
public function getRouteKeyName()
{
return 'slug';
}