Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. // view.blade.php
  2. @foreach ($permissions as $permission)
  3. <div>
  4. <input type="checkbox" name="permissions[]" value="{{ $permission->id }}" @if( in_array($permission->id, $checked) ) checked @endif>{{ $permission->description }} [{{ $permission->name }}]
  5. </div>
  6. @endforeach
  7. // rolecontroller.php editPermit()
  8.  
  9. $permissions = Permission::all();
  10.  
  11. $checked = $role->permissions()->lists('id')->toArray();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement