I wonder if it's problematic to do this type of validation in Laravel
views.
Example: Only one master user can delete a certain record, so I have the delete button only if the user is master (logically validating the deletions in Controller
).
Exemplifying in code:
@if(Auth::user()->administrator)
<a title="Excluir" href="/users/delete/{{$user->id}}">
<i class="fa fa-trash-o" aria-hidden="true"></i>
</a>
@endif
Is it okay to do this, or is it preferable to create new views for an admin user if he has fewer privileges than a regular user?