0
votes

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?

1

1 Answers

4
votes

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
    }
}