Extending list query look up from outside controller
Ad
The docs shows how to extend the look up query for a backend list from inside a controller using listExtendQuery
Can it be extended from outside the controller i.e from another plugin?
Ad
Answer
Ad
Use Event in boot() function of your plugin
Event::listen('backend.list.extendQuery', function ($widget, $query) {
// Check your model
if ($widget->model instanceof \You\Plugin\Models\YourModel) {
// extend $query
}
}
Ad
source: stackoverflow.com
Related Questions
Ad
- → OctoberCMS Backend Loging Hash Error
- → "failed to open stream" error when executing "migrate:make"
- → OctoberCMS - How to make collapsible list default to active only on non-mobile
- → Create plugin that makes objects from model in back-end
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → How to install console for plugin development in October CMS
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS create a multi select Form field
- → How to update data attribute on Ajax complete
- → October CMS - Conditionally Load a Different Page
Ad