Add a new layout column.

@param int      $width
@param \Closure $closure

@return $this
761879
public function column($width, \Closure $closure)
    {
        $width = $width < 1 ? round(12 * $width) : $width;

        $this->layout->column($width, $closure);

        return $this;
    }
339073
public function extend(Closure $callback = null)
    {
        !is_null($callback) && call_user_func($callback, $this->grid, $this->container->make('request'), $this->container->make('translator'));

        return $this;
    }
1200517
public static function make($table, Closure $closure)
    {
        if (is_array($table)) {
            $table = isset($table['table']) ? $table['table'] : $table;
            $database = isset($table['database']) ? $table['database'] : null;
            $schema = new static($table, $database);
        } else {
            $schema = new static($table);
        }

        $callback = $closure($schema);
        /*
        | Set database connection name
        */
        $schema->on($schema->getDatabase());
        $schema->run();

        return $callback;
    }
85331
public function functions(\Closure $search, \Closure $closure, $parameters = [])
    {
        $builder = new self($this->connection, new $this->query());
        $search($builder);

        $builder = new FunctionScoreBuilder($builder, $parameters);

        $closure($builder);

        $this->append($builder->getQuery());

        return $this;
    }
307206
public function each(Closure $closure)
    {
        foreach ($this->stack as &$item) {
            $closure($item);
        }

        return $this;
    }
150771
public function newNestedInstance(Closure $closure = null)
    {
        $query = $this->newInstance()->nested();

        if ($closure) {
            call_user_func($closure, $query);
        }

        return $query;
    }
573125
public function fullJoin($table, Closure $closure)
    {
        $this->sql->addJoinClause('FULL', $table, $closure);
        return $this;
    }
335683
public function before(\Closure $closure = null)
    {
        if (null !== $closure) {
            $this->before[] = $closure;

            return $this;
        }

        return $this->before[] = new ExprBuilder($this->node);
    }
272877
public function leftJoin($table, Closure $closure)
    {
        $this->sql->addJoinClause('LEFT', $table, $closure);
        return $this;
    }
267591
public function addColumn($width = 'auto')
    {
        /** @type View $c */
        $c = $this->add('View');
        if (is_numeric($width)) {
            $this->mode = 'grid';
            $c->addClass('atk-col-'.$width);

            return $c;
        } elseif (substr($width, -1) == '%') {
            $this->mode = 'pct';
            $c->addStyle('width', $width);
        }
        $this->template->trySet('row_class', 'atk-cells');
        $c->addClass('atk-cell');

        return $c;
    }
1118456
public function nested($field, \Closure $closure, $score_mode = 'avg')
    {
        $builder = new self($this->connection, new $this->query());

        $closure($builder);

        $nestedQuery = $builder->query->getQueries();

        $query = new NestedQuery($field, $nestedQuery, ['score_mode' => $score_mode]);

        $this->append($query);

        return $this;
    }
142383
protected function addCondition($column, Closure $value = null, $separator = 'AND'): self
    {
        if (($column instanceof Closure) && $value === null) {
            $this->sql->addHavingGroupCondition($column, $separator);
        } else {
            $expr = $this->expression->init($column, $separator);
            if ($value) {
                $value($expr);
            }
        }
        return $this;
    }
284555
public function orHaving($column, Closure $value = null): self
    {
        $this->have->orHaving($column, $value);
        return $this;
    }
276865
public function column($width, $content)
    {
        $width = $width < 1 ? round(12 * $width) : $width;

        $column = new Column($content, $width);

        $this->addColumn($column);
    }
825896
public function extend($abstract, \Closure $closure)
        {
            if (!Arrays::exists($abstract, $this->bindings)) {
                throw new \InvalidArgumentException("Type {$abstract} is not bound.");
            }
            // To "extend" a binding, we will grab the old "resolver" Closure and pass it
            // into a new one. The old resolver will be called first and the result is
            // handed off to the "new" resolver, along with this container instance.
            $resolver = $this->bindings[$abstract]['concrete'];
            $this->bind($abstract, function($container) use ($resolver, $closure) {
                return $closure($resolver($container), $container);
            }, $this->isShared($abstract));
        }
268377
public function ifTrue(\Closure $closure = null)
    {
        if (null === $closure) {
            $closure = function ($v) { return true === $v; };
        }

        $this->ifPart = $closure;

        return $this;
    }
310523
protected function getExtender($abstract, Closure $closure)
		{
			// To "extend" a binding, we will grab the old "resolver" Closure and pass it
			// into a new one. The old resolver will be called first and the result is
			// handed off to the "new" resolver, along with this container instance.
			$resolver = $this->bindings[$abstract]['concrete'];

			return function($container) use ($resolver, $closure) {
				$args = array();
				$res = call_user_func_array($resolver, array($container));
				array_push($args, $res);
				array_push($args, $container);
				return call_user_func_array($closure, $args);
			};
		}