tl;dr
It is up to you.
Alternate solution
You could create a variable for your constant and pass it to the view:
$roleNames = User::ROLE_NAMES;
return View::make("membership.edit", compact('roleNames'));
Then in the view:
<td>@lang("app.{$roleNames[$member->pivot->role_id]}")</td>
Advantages
Shorter: You don't have to write the fully qualified name of the model. This is pretty handy if you have a deep model structure or long model names.
You can "rename" the constant: Sometimes constant names are general. By passing a variable you can give a more descriptive name for the variable that can tell how exactly you use those constants in that given context.
It is clearer what the view works with: The controller's job is to provide the needed resources (for the view) to generate a response to the request. If you pass the constants to the view in the controller, you can see what resources the view works with.
Disadvantages
Of course there can be down sides too, when using this method is cumbersome. If you have many constants (for example for each user role) then probably you don't want to pass all of them to the view, because you will end up with something like this:
$noRole = User::NO_ROLE;
$memberRole = User::MEMBER_ROLE;
$adminRole = User::ADMIN_ROLE;
$moderatorRole = User::MODERATOR_ROLE;
$reviewerRole = User::REVIEWER_ROLE;
$publisherRole = User::PUBLISHER_ROLE;
return View::make("membership.edit", compact(
'noRole',
'memberRole',
'adminRole',
'moderatorRole',
'reviewerRole',
'publisherRole'
));
The main problems with this:
Lot of unnecessary code for a trivial functionality.
Hard to maintain, especially if your view uses only a few of them.
Violates DRY, especially if you need to do this in almost all function that returns a view.
Of course you could refactor this, create helper functions, but why would you deal with all of this hassle when (in this case) using the constants directly in the view is straightforward and easy to understand:
@if ($user->role === App\User::ADMIN_ROLE)
The rule of thumb is to use the solution that is easier to read and understand. Except if you have a style guide, then you should follow that.