Advertisement
Guest User

Untitled

a guest
Sep 28th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. public function addPermissionsToRoleHandler($rid, Request $request)
  2. {
  3. $role = Role::find($rid);
  4. dd($request->permissions);
  5. foreach($request->permissions as $perm)
  6. {
  7. $permission = Permission::find($perm->id);
  8. $role->attachPermission($permission);
  9. }
  10.  
  11. return redirect()->route('showSpecificRole', $rid);
  12. }
  13.  
  14. {!! Form::select('permissions[]', $permissions, null, array('class' => 'selectpicker show-tick', 'data-live-search' => 'true', 'id' => 'permission_select', 'multiple' => true)) !!}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement