Create a new menu builder instance.

@param string   $name
@param callable $callback

@return Builder
554547
public function make($name, $callback)
    {
        if (!is_callable($callback)) {
            return null;
        }

        if (!array_key_exists($name, $this->menu)) {
            $this->menu[$name] = new Builder($name, $this->loadConf($name));
        }

        // Registering the items
        call_user_func($callback, $this->menu[$name]);

        // Storing each menu instance in the collection
        $this->collection->put($name, $this->menu[$name]);

        // Make the instance available in all views
        View::share($name, $this->menu[$name]);

        return $this->menu[$name];
    }
1104930
public function addFilter($name, callable $callback)
	{
		$filter = new Filter($name, $callback);

		$this->filters->add($filter);

		return $filter;
	}
343035
public function createTable($name, callable $callback, $ifNotExists = true, $options = [])
    {
        $options = $this->prepareBCOptions($options);

        return $this->getTable($name)->create($callback, $ifNotExists, $options);
    }
76262
protected function createStringCallback($callback, array $parameters)
    {
        if (function_exists($callback)) {
            return $this->createCallableCallback($callback, $parameters);
        } else {
            return $this->createClassesCallback($callback, $parameters);
        }
    }
489929
public function add(string $name, callable $callback): self
    {
        call_user_func($this->addCallback, $name, $callback);
        return $this;
    }
541532
public function register($name, Closure $callback): void
    {
        if ($this->has($name)) {
            $this->callbacks = $this->callbacks->put($name, $this->callbacks->get($name, collect())->push($callback));
        } else {
            $builder = new MenuGenerator();

            $builder->setViewFactory($this->viewFactory);

            $this->menus->put($name, $builder);

            $this->callbacks = $this->callbacks->put($name, $this->callbacks->get($name, collect())->push($callback));
        }
    }
477491
public static function createCallback(string $name, callable $callback): NormalizationFieldMappingBuilderInterface
    {
        $self = new self($name);
        $self->fieldNormalizer = new CallbackFieldNormalizer($callback);

        return $self;
    }
331301
protected function addEventListener($name, $callback)
    {
        if (Str::contains($name, '*')) {
            $callback = function ($name, array $data) use ($callback) {
                return $callback($data[0]);
            };
        }

        $this->events->listen($name, $callback);
    }
523349
protected function createClassesCallback($callback, array $parameters)
    {
        list($className, $method) = Str::parseCallback($callback, 'register');

        $instance = $this->container->make($className);

        $callable = array($instance, $method);

        return $this->createCallableCallback($callable, $parameters);
    }
1166220
public function when(string $name, callable $callback) : Event
    {
        if ($this->matchEventName($name, $this)){
            ($callback)($this);
            $this->consumed = true;
        }
        return $this;
    }
1195541
function createIndex($name, $callback = false)
    {

        $index = new Index($name, $callback);

        $index->connection = $this->connection;

        return $index->create();
    }
795764
public function callback(string $name, callable $callback): self
    {
        $this->callbacks[$name] = $callback;
        return $this;
    }
952415
public function create($name, Closure $resolver)
    {
        $builder = new MenuBuilder($name, $this->config);

        $builder->setViewFactory($this->views);

        $this->menus[$name] = $builder;

        return $resolver($builder);
    }
694175
protected function buildControl($name, $callback = null, $type = null)
    {
        list($label, $name, $callback) = $this->buildFluentAttributes($name, $callback);

        $control = new Field([
            'id'         => $name,
            'name'       => $name,
            'value'      => null,
            'label'      => $label,
            'attributes' => [],
            'options'    => [],
            'checked'    => false,
            'type'       => $type,
            'field'      => null,
        ]);
        is_callable($callback) && call_user_func($callback, $control);

        return [$name, $control];
    }
196724
public static function set(string $name, callable $callback)
    {
        if ($name = \trim($name)) {
            self::$validators[$name] = $callback;
        }
    }
1132678
public function trial($name, callable $callback, $context = null)
    {
        $this->trials[$name] = new Trial($name, $callback, $context);

        return $this;
    }
250555
protected function setArray($name, callable $callback = null)
    {
        return $this->field(Type::TARRAY, $name, $callback);
    }