I really don't in authorization, I make sure a method that requires a role of bookkeeper (just example)
is one of the logged in users roles, if not I redirect.
And to protect a url (where a user can change an id in the url), I make sure only the logged in users id in used in a query.
That way if someone changed a 5 to a 2, they won't get data, I also redirect / or throw 403.
How are you using the slug, is it something unique to a user? If it is you could protect it just like you protect an id from being changed. I just prefer the user id myself.
And if admin can see all, but user sees just their data I use a scope,:
public function scopegetPets($query, $petsearch = '')
{
$petsearch = $petsearch . "%";
$query->where('petname', 'like', $petsearch);
if (ChkAuth::chkRole('admin') === false) { // use your auth
$userid = Auth::user()->id;
$query->where('ownerid', '=', $userid);
}
$results = $query->orderBy('petname', 'asc')->paginate(5);
return $results;
}
So one scope can be used to show all or just user data.
Ignore the ChkAuth part, I use authentication out of box, but implement some custom authorization.
But a scope is handy for certain situations.
Edit:
Also, I am no expert on blade, but couldn't you just use sections depending on a condition.
If this, then this section, if that, then another section. I know all the @cans with multiple if's can get a little messy.
I would just use separate views, unless you work out sections.
I just like checking Auth at method level and have simple views.