getRepo()->findByPublicIdsWithTrashed($ids); foreach ($entities as $entity) { if(Auth::user()->can('edit', $entity)){ $this->getRepo()->$action($entity); } } return count($entities); } }