protected function addCustomfield($grid, $field)
    {
        if (!$field instanceof \Antares\Customfield\CustomField) {
            $customfield = with(new \Antares\Customfield\CustomField())->attributes($field);
        } else {
            $customfield = $field;
        }
        $customfield->setModel($grid->row);
        $this->add($customfield);
        if (is_null($grid->rules)) {
            $grid->rules([]);
        }
        $grid->rules(array_merge($grid->rules, $customfield->getRules()));

        $grid->row->saved(function ($row) use ($customfield) {
            $customfield->onSave($row);
        });
    }