public function extract(Listener $listener, $category = null, array $input)
    {

        try {
            $subdir = !is_null($category) ? $category : 'addons';
            $target = realpath(app_path() . "/../src/modules/{$subdir}");
            if (!is_dir($target)) {
                throw new \Exception('Invalid path of module provided');
            }

            $name = $input['name'];
            $path = storage_path() . '/app/uploads/' . $name;
            if (!file_exists($path)) {
                throw new \Exception('Invalid path of module package');
            }

            if ($this->unzip($path, $target)) {
                return $listener->moduleExtracted($category);
            }
            return $listener->moduleExtractionError($category);
        } catch (\Exception $e) {
            Log::emergency($e);
            return $listener->moduleExtractionError($category);
        }
    }