Register new department

@param $name
@param Closure $callback
@return $this
194171
public function department($name, Closure $callback)
    {
        $department = $this->createDepartment($name);

        call_user_func($callback, $department);

        if (is_null(static::$departments)) {
            static::$departments = Collection::make([]);
        }

        static::$departments->push($department);

        return $this;
    }
586783
public function attachment(Closure $callback)
    {
        $this->attachments[] = $attachment = new Attachment;

        $callback($attachment);

        return $this;
    }
309092
public function group($name, $action, Closure $callback)
    {
        static::$groups[$name] = [
            'action' => $action,
            'callback' => $callback
        ];

        return $this;
    }
728000
protected function addRow(\Closure $callback)
    {
        $row = new DashboardLayoutRow();

        $callback($row);

        $this->rows[] = $row;

        return $this;
    }
364709
public function table($name, $callback = null)
    {   
        if (! $callback instanceof \Closure) {
            throw InvalidArgumentPassedException::isNotClosure();
        }

        $this->setTableName($name);

        $callback($this);
        
        $tableNamePrefixed = $this->getTableNamePrefix($this->getTableName());
        $tableStructure = \substr($this->getColumnsQuery() . $this->getPrimaryKeyQuery(), 0, -2);
        $tableCharsetCollate = $this->getCharacterSetCollate();

        $this->buildCreateTableQuery($tableNamePrefixed, $tableStructure, $tableCharsetCollate);

        $this->flushColumns();
        $this->flushPrimaryKey();
    }
1248341
public static function make($name, Closure $callback = null)
    {
        $menu = new self($name);
        if ( ! is_null($callback)) {
            call_user_func($callback, $menu);
        }

        return $menu;
    }
335751
public function withAttribute($name, $callback = null)
    {
        if (is_array($name)) {
            foreach ($name as $key => $val) {
                $key = Db::parseName($key);

                $this->withAttr[$key] = $val;
            }
        } else {
            $name = Db::parseName($name);

            $this->withAttr[$name] = $callback;
        }

        return $this;
    }
905850
public function addFilter($callback, $name = null)
    {
        $tuple = $this->createFilterTuple(func_get_args());

        $this->filters[] = $tuple;

        $this->handleChangedParameters();

        return $this;
    }
12370
public function add(string $name, callable $callback): self
    {
        if ($this->exists($name)) {
            throw new LogicException(
                'The helper function name "' . $name . '" is already registered.'
            );
        }

        $this->helpers[$name] = $callback;

        return $this;
    }
120053
public function start(Closure $callback)
    {
        $this->output = $callback;

        $this->cooldown();

        $this->process->start($callback);

        return $this;
    }
1094266
public function map(\Closure $callback)
    {

        $this->_items = array_map($callback, $this->_items);

        return $this;
    }
940022
public function bind(string $name, callable $callback): self
    {
        $this->data->bind($name, $callback);
        return $this;
    }
374658
public function onRegister($name, Closure $callback)
    {
        $priority                  = $this->getPluginPriority($name);
        $this->registerCallbacks[] = compact('name', 'priority', 'callback');
    }
966627
public function hidden($name, $callback = null)
    {
        $value = data_get($this->row, $name);

        $field = new Fluent([
            'name'       => $name,
            'value'      => $value ?: '',
            'attributes' => [],
        ]);

        if ($callback instanceof Closure) {
            call_user_func($callback, $field);
        }

        $this->hiddens[$name] = $this->app->make('form')->hidden($name, $field->get('value'), $field->get('attributes'));
    }
827410
public function withAttr($name, $callback = null)
    {
        if (is_array($name)) {
            $this->options['with_attr'] = $name;
        } else {
            $this->options['with_attr'][$name] = $callback;
        }

        return $this;
    }
1282314
public function setConstraint(Closure $callback)
    {
        $this->data            = [];
        $this->loaded          = false;
        $this->queryConstraint = $callback;

        return $this;
    }
1198736
public function register($name, $callback)
    {
        $this->widgets[$name] = $callback;

        $this->registerBlade($name);
    }