Here is some supporting code:
I created my button using
Event::listen('admin.toolbar.extendButtonsBefore', function (Toolbar $toolbar) {
if ($toolbar->getController() instanceof Customers){
$toolbar->buttons['edit_balance'] = [
'label' => 'Edit Balance',
'class' => 'btn btn-default',
'context' => ['edit'],
];
}
});
I know I have to create a config form to say what fields I would like to display, however those fields come from a model that is not Customers_model. Is there a function inside the Customers controller that I should write (using extend) to handle the logic to grab the custom model and the custom config file to display the form.
I see that the modal pop up in the record editor have instances of Admin/Widgets/Form. Where do I instantiate the form in my custom code?
Thank you!