I want to extend the Orders for Shopaholic plugin, so the Offer list in Order has some more information from the parent product. I am trying to use relationExtendConfig, the Order model has the relationBehavior and config but I am getting Call to undefined method Lovata\OrdersShopaholic\Controllers\Orders::relationExtendConfig()
so I am not sure if I need to extend the controller or what? Thank you
Hi @Vosco
This is a controller method override. You may need to extend the List widget globally and filter it down to determine if it happens inside the relation. Here is an example:
Event::listen('backend.list.extendColumns', function ($listWidget) {
// Only for the User controller
if (!$listWidget->getController() instanceof \Backend\Controllers\Users) {
return;
}
// Only for the User model
if (!$listWidget->model instanceof \Backend\Models\User) {
return;
}
// Add an extra birthday column
$listWidget->addColumns([
'birthday' => [
'label' => 'Birthday'
]
]);
// Remove a Surname column
$listWidget->removeColumn('surname');
});