/**
  * @param  Role $role
  * @throws GeneralException
  * @return bool
  */
 public function destroy(Role $role)
 {
     //Would be stupid to delete the administrator role
     if ($role->id == 1) {
         //id is 1 because of the seeder
         throw new GeneralException(trans('exceptions.backend.access.roles.cant_delete_admin'));
     }
     //Don't delete the role is there are users associated
     if ($role->users()->count() > 0) {
         throw new GeneralException(trans('exceptions.backend.access.roles.has_users'));
     }
     DB::transaction(function () use($role) {
         //Detach all associated roles
         $role->permissions()->sync([]);
         if ($role->delete()) {
             event(new RoleDeleted($role));
             return true;
         }
         throw new GeneralException(trans('exceptions.backend.access.roles.delete_error'));
     });
 }