示例#1
0
 /**
  * Remove the specified role from storage.
  *
  * @param RoleInterface $role
  * @internal param int $id
  * @return Response
  */
 public function destroy(RoleInterface $role)
 {
     $response = null;
     $user = $this->getUser();
     if ($user->can('delete', $role)) {
         if ($this->role_repository->delete($role)) {
             $response = Redirect::route('roles.role.index')->with('success', trans('roles::role.delete_success'));
         } else {
             $response = Redirect::back()->withErrors($this->role_repository->getErrors());
         }
     } else {
         $response = Redirect::home();
     }
     return $response;
 }