Create Placeholder driver.

@param  string  $name

@return \Orchestra\Widget\Handlers\Placeholder
323333
protected function createPlaceholderDriver(string $name): Handlers\Placeholder
    {
        $config = $this->app->make('config')->get("orchestra/widget::placeholder.{$name}", []);

        return new Handlers\Placeholder($name, $config);
    }
1119639
public function createControl(string $name): Control
  {
    $control = new TableColumnControl($name);
    $control->setTableColumn($this->tableColumn);

    return $control;
  }
931175
public static function create($name = 'null') {
    $is_upper = FormatterFactory::getDefaultFormatter()->getConfig('boolean_null_upper');
    $node = new NullNode();
    $node->addChild(NameNode::create($is_upper ? 'NULL' : 'null'), 'constantName');
    return $node;
  }
733150
public function widget(string $name) : Widget\WidgetLabelDefiner
    {
        return new WidgetLabelDefiner($name, $this->authSystem, $this->requiredPermissions, $this->tables, $this->charts, $this->actions,
            function (IWidget $widget) {
                $this->widgets[$widget->getName()] = $widget;
            });
    }
1238543
public static function create($name)
    {
        if (!isset(self::$adapters[$name])) {
            throw HttpAdapterException::httpAdapterDoesNotExist($name);
        }

        if (!self::capable($name)) {
            throw HttpAdapterException::httpAdapterIsNotUsable($name);
        }

        return new self::$adapters[$name]['adapter']();
    }
170221
protected function buildClass($name)
    {
        $stub = $this->files->get($this->getStub());

        // examples used for the placeholders is for 'foo.bar'

        // App\Foo
        $stub = str_replace('{{namespace}}', $this->getNamespace($name), $stub);

        // App\
        $stub = str_replace('{{rootNamespace}}', $this->getAppNamespace(), $stub);

        // Bar
        $stub = str_replace('{{class}}', $this->getClassName(), $stub);

        $url = $this->getUrl(); // /foo/bar

        // /foo/bar
        $stub = str_replace('{{url}}', $this->getUrl(), $stub);

        // bars
        $stub = str_replace('{{collection}}', $this->getCollectionName(), $stub);

        // Bars
        $stub = str_replace('{{collectionUpper}}', $this->getCollectionUpperName(), $stub);

        // Bar
        $stub = str_replace('{{model}}', $this->getModelName(), $stub);

        // Bar
        $stub = str_replace('{{resource}}', $this->resource, $stub);

        // bar
        $stub = str_replace('{{resourceLowercase}}', $this->resourceLowerCase, $stub);

        // ./resources/views/foo/bar.blade.php
        $stub = str_replace('{{path}}', $this->getPath(''), $stub);

        // foos.bars
        $stub = str_replace('{{view}}', $this->getViewPath($this->getUrl(false)), $stub);

        // bars
        $stub = str_replace('{{table}}', $this->getTableName($url), $stub);

        // event - listeners
        $event = $this->option('event');

        if (!Str::startsWith($event, $this->laravel->getNamespace()) && !Str::startsWith($event,
                'Illuminate')
        ) {
            $event = $this->laravel->getNamespace() . 'Events\\' . $event;
        }

        // event class name
        $stub = str_replace('{{event}}', class_basename($event), $stub);

        // event with namespace
        $stub = str_replace('{{eventAndNamespace}}', $event, $stub);

        return $stub;
    }
366951
public function createElement($name)
    {
        $elementClass = $this->classNameResolver->resolveElement($name);

        return $this->instantiateElement($elementClass);
    }
1178572
protected function makeCurrentDriver(string $name): ITaxFacade
    {
        $this->currentDriver = app($this->getDriver($name), [
            'config' => config('taxes.' . $name),
        ]);

        return $this;
    }
734397
public function buildCustomProvider(string $name, array $driverConfig = null)
    {
        if (!$driverConfig) {
            $driverConfig = $this->getConfig('drivers.' . $name);
        }

        $driverConfig['name'] = $name;

        if (isset($driverConfig['enabled']) && $driverConfig['enabled'] === false) {
            return null;
        }

        if (!isset($driverConfig['redirect'])) {
            $driverConfig['redirect'] = $this->getConfig('routes.redirect') . '/' . $name;
        }

        if (!isset($driverConfig['callback'])) {
            $driverConfig['callback'] = $this->getConfig('routes.callback') . '/' . $name;
        }

        if ($this->hasBuildInDriver($name)) {
            $this->drivers[ $name ] = $this->{static::buildInDriverMethodName($name)}($driverConfig);
        } else {
            $provider = (!empty($driverConfig['provider']) && class_exists((string)$driverConfig['provider']))
                ? $driverConfig['provider']
                : CustomProvider::class;

            $this->drivers[ $name ] = $this->buildProvider($provider, $driverConfig);
        }

        return $this->drivers[ $name ];
    }
144256
public function create(string $name): Channel
    {
        if (!array_has($this->channels, $name)) {
            throw new ChannelNotFound('Channel `'.$name.'` not found.');
        }

        $parameters = $this->channels[$name];

        // Create driver and initialize it with channel parameters
        $driver = $this->createDriver($parameters['driver']);
        $driver->initialize(collect($parameters)->except('driver'));

        return new Channel($name, $driver, $parameters['webhook-secret'] ?? null);
    }
227125
public function getController(string $name = '')
    {
        if (empty($name)) {
            $name = $this->getComponentsName();
        }

        $controller = $this->MVCFactory($name, 'Controller');

        return $controller;
    }
755361
public function setCurrentDriver(string $name): ITaxFacade
    {
        $this->currentDriverName = $name;

        $this->makeCurrentDriver($name);

        return $this;
    }
18968
public function createNodeController($name)
    {
        $controller = new \PAGI\Node\NodeController();
        return $controller->setName($name)->setAgiClient($this);
    }
837619
protected function makeConnection($name)
    {
        $config = $this->getConfig($name);

        // First we will check by the connection name to see if an extension has been
        // registered specifically for that connection. If it has we will call the
        // Closure and pass it the config allowing it to resolve the connection.
        if (isset($this->extensions[$name])) {
            return call_user_func($this->extensions[$name], $config, $name);
        }

        $driver = $config['driver'];

        // Next we will check to see if an extension has been registered for a driver
        // and will call the Closure if so, which allows us to have a more generic
        // resolver for the drivers themselves which applies to all connections.
        if (isset($this->extensions[$driver])) {
            return call_user_func($this->extensions[$driver], $config, $name);
        }

        return $this->factory->make($config, $name);
    }
611076
protected function makeConnection(string $name)
    {
        $config = $this->getConnectionConfig($name);

        if (isset($this->extensions[$name])) {
            return $this->extensions[$name]($config);
        }

        if ($driver = array_get($config, 'driver')) {
            if (isset($this->extensions[$driver])) {
                return $this->extensions[$driver]($config);
            }
        }

        return $this->createConnection($config);
    }
562841
protected function resolve($name)
    {
        $config = $this->getConfig($name);

        if (is_null($config)) {
            throw new InvalidArgumentException("Broadcaster [{$name}] is not defined.");
        }

        if (isset($this->customCreators[$config['driver']])) {
            return $this->callCustomCreator($config);
        }

        $driverMethod = 'create'.ucfirst($config['driver']).'Driver';

        if (! method_exists($this, $driverMethod)) {
            throw new InvalidArgumentException("Driver [{$config['driver']}] is not supported.");
        }

        return $this->{$driverMethod}($config);
    }
682749
public function placeholder(string $name, string $value): self
    {
        $this->data->placeholder($name, $value);
        return $this;
    }