private function writeConfig()
    {
        if ($this->option('write-config'))
        {
            $configFile = base_path() . '/config/larasearch.php';

            if ($this->getLaravel())
            {
                if ( ! File::exists($configFile))
                {
                    if ($this->confirm('It appears that you have not yet published the larasearch config. Would you like to do this now?', false))
                    {
                        $this->call('vendor:publish', ['--provider' => 'Iverberk\\Larasearch\LarasearchServiceProvider', '--tag' => 'config']);
                    }
                    else
                    {
                        return;
                    }
                }
            }
            else
            {
                if ( ! File::exists($configFile))
                {
                    $this->info('Lumen application detected. Please copy the config manually to config/larasearch.php.');
                }
            }

            File::put(dirname($configFile) . "/paths.json", json_encode(['paths' => $this->paths, 'reversedPaths' => $this->reversedPaths], JSON_PRETTY_PRINT));

            $this->info('Paths file written to local package configuration');
        }
        else
        {
            $this->info(json_encode(['paths' => $this->paths, 'reversedPaths' => $this->reversedPaths], JSON_PRETTY_PRINT));
        }
    }