getList()); } public function delete($id, AttachmentsModel $model) { $ids = Utils::stringToArrayBy($id); foreach ($ids as $id) { $attachment = $model->findBy($id); if ($attachment && $model->deleteBy($id)) { Filesystem::delete($attachment->path); } } return CatchResponse::success(); } }