protected function delete($file, $expires)
    {
        if (!is_array($file['path'])) {
            $file['path'] = [$file['path']];
        }
        
        foreach ($file['path'] as $path) {
            if (File::exists($path)) {
                if ((time() - File::lastModified($path)) >= $expires) {
                    if (!empty($file['before']) && is_callable($file['before'])) {
                        $file['before']($path);
                    }
                    if (File::isDirectory($path)) {
                        File::deleteDirectory($path);
                    } else {
                        File::delete($path);
                    }
                    if (!empty($file['after']) && is_callable($file['after'])) {
                        $file['after']($path);
                    }
                }
            }
        }
    }