On the controller, write a function that takes into account the user id, and show the tasks only related to the authenticated user. on the routes, direct them to that from an endpoint, for instance, /mytasks
Write another function on the controller and display all tasks, with an endpoint like /alltasks
There are a couple of ways to display the link in blade, perhaps write a function on the user model that checks for it, such as
public function hasRole($role)
{
//check for user to have a particular role
if($this->roles()->where('title', $role)->first()){
return true;
}
return false;
}
and then test for the admin role and display the /alltasks link , else display the /mytasks link on your blade template