/**
  * Adds the requested permissions to the specified role.
  *
  * @param RolePermissionRequest $request
  * @param int|string            $roleId
  *
  * @return array|false
  */
 public function store(RolePermissionRequest $request, $roleId)
 {
     $this->authorize('admin.roles.permissions.store');
     $role = $this->role->findOrFail($roleId);
     $permissions = $request->input('permissions', []);
     if (count($permissions) > 0) {
         $permissions = $this->permission->findMany($permissions);
         return $role->permissions()->saveMany($permissions);
     }
     return false;
 }
 /**
  * Adds the requested permissions to the specified role.
  *
  * @param RolePermissionRequest $request
  * @param int|string            $roleId
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function store(RolePermissionRequest $request, $roleId)
 {
     $this->authorize('admin.roles.permissions.store');
     $role = $this->role->findOrFail($roleId);
     $permissions = $request->input('permissions', []);
     if (count($permissions) > 0) {
         $permissions = $this->permission->findMany($permissions);
         $role->permissions()->saveMany($permissions);
         flash()->success('Success!', 'Successfully added permissions.');
         return redirect()->route('admin.roles.show', [$roleId]);
     }
     flash()->error('Error!', "You didn't select any permissions.");
     return redirect()->route('admin.roles.show', [$roleId]);
 }