Encore\Admin\Grid::__call PHP Метод

__call() публичный Метод

Dynamically add columns to the grid view.
public __call ( $method, $arguments )
$method
$arguments
    public function __call($method, $arguments)
    {
        if ($this->model()->eloquent() instanceof MongodbModel) {
            $label = isset($arguments[0]) ? $arguments[0] : ucfirst($method);
            return $this->addColumn($method, $label);
        }
        $connection = $this->model()->eloquent()->getConnectionName();
        if (Schema::connection($connection)->hasColumn($this->model()->getTable(), $method)) {
            $label = isset($arguments[0]) ? $arguments[0] : ucfirst($method);
            return $this->addColumn($method, $label);
        }
        $relation = $this->model()->eloquent()->{$method}();
        if ($relation instanceof Relation) {
            $this->model()->with($method);
            return $this->addColumn()->setRelation($method);
        }
    }