public function showConnector()
{
$roots = $this->app->config->get('elfinder.roots', []);
if (empty($roots)) {
$dirs = (array) $this->app['config']->get('elfinder.dir', []);
foreach ($dirs as $dir) {
$roots[] = ['driver' => 'LocalFileSystem', 'path' => public_path($dir), 'URL' => url($dir), 'accessControl' => $this->app->config->get('elfinder.access')];
}
$disks = (array) $this->app['config']->get('elfinder.disks', []);
foreach ($disks as $key => $root) {
if (is_string($root)) {
$key = $root;
$root = [];
}
$disk = app('filesystem')->disk($key);
if ($disk instanceof FilesystemAdapter) {
$defaults = ['driver' => 'Flysystem', 'filesystem' => $disk->getDriver(), 'alias' => $key];
$roots[] = array_merge($defaults, $root);
}
}
}
$opts = $this->app->config->get('elfinder.options', array());
$opts = array_merge(['roots' => $roots], $opts);
// run elFinder
$connector = new Connector(new \elFinder($opts));
$connector->run();
return $connector->getResponse();
}