title: laravel entrust how to check a role's permission in blade?
body: <p>I am using entrust in my laravel project.
  In blade file when I edit a role I want to display all the permissions with checkbox.</p>
  
  <p>But I stuck at the thought that I want the checkbox status is checked if the role has the permission.I pass the role and all permissions to blade ,and try</p>
  
  <pre><code>@foreach($permissions as $permission)
    &lt;input type="checkbox" value="{{$permission-&gt;name}}"
      @if($role-&gt;hasPermission($permission-&gt;name))
      checked="checked"
      @endif
  @endforeach
  </code></pre>
  
  <p>but it didn't work </p>
  
  <p>I also try convert $role and $permissions to array and pass them to blade and use foreach twice ,it didn't work either.
  Is there any way to make it?</p>