So you are calling the method tenants() and you are trying to return municipalities it is a bit confusing.
However, Municipality::all(); returns an instance of Collection and the relationship method returns a query builder instance.
Municipality::all() also won't return the pivot model, in case you have additional columns there.
So I would suggest you move this logic in another class, either controller or action/service class whatever you use to get this data, and do the check there instead of the model. Because a relationship method under the hood uses the instance primary data to associate the corresponding data from the database, so you cannot ignore the user_id.
it will be like this:
$tenants = null;
if ($user->isSuperAdmin())
{
$tenants = Municipality::all();
}
else
{
$tenants = $user->tenants;
}