/** * Finally delete content item */ public function make() { // remove gallery files if exists foreach ($this->_records->get() as $record) { $galleryPath = '/upload/gallery/' . (int) $record->id; if (Directory::exist($galleryPath)) { Directory::remove($galleryPath); } } // finally remove from db $this->_records->forceDelete(); }