I'm using laratrust with roles and permission, now in my Roles edit-page, I loop all my permissions and I'm trying to make the checkbox auto check based on the permissions that are already given to a certain role.
Now I'm getting an error:
(Parse error: syntax error, unexpected ':', expecting)
Could anyone fix my code?
Edit.Blade
<div class="from-group">
@foreach ($permissions as $permission)
<div class="checkbox">
<label>
<input
type="checkbox"
name="permissions[]"
value="{{$permission->id}}"
@if($role->permissions)
@if(in_array($permission->id, $role->permissions->pluck('id')))
checked
@endif
@endif
>
<span>
{{$permission->display_name}}
<em>({{$permission->description}})</em>
</span>
</label>
</div>
@endforeach
</div>