I'm trying to extend backend user fields in octobercms but after adding a new field if I try to save the form there's an error says that this field doesn't exist in database. So how can add a column for my new field? Here's my code:
public function boot()
{
// Extend all backend form usage
Event::listen('backend.form.extendFields', function($widget) {
// Only for the User controller
if (!$widget->getController() instanceof \Backend\Controllers\Users) {
return;
}
// Only for the User model
if (!$widget->model instanceof \Backend\Models\User) {
return;
}
// Add an extra birthday field
$widget->addTabFields([
'birthday' => [
'label' => 'Birthday',
'comment' => 'Select the users birthday',
'type' => 'datepicker',
'tab' => 'Billing'
]
]);
});
}