Save october CMS formWidget data to database table

897 Views Asked by At

I have a plugin and I have included a FormWidget to that with some fields. those are in a partial. When i click create I can see the fields from the partial via the FormWidget but I am not sure how I can save values form those fields to db. What method do i need to call from the FormWidget class in order to save data to a model?

1

There are 1 best solutions below

0
On

Found it,

in the Formwidget class override the default function like this.

public function getSaveValue($value)
{
    return $value;
}

for more info. https://octobercms.com/docs/backend/widgets under "Saving form data"