从外部控制器扩展列表查询查找

Extending list query look up from outside controller

The docs 显示如何使用 listExtendQuery
从控制器内部扩展对后端列表的查找查询 它可以从控制器外部扩展,即从另一个插件扩展吗?

在插件的 boot() 函数中使用事件

Event::listen('backend.list.extendQuery', function ($widget, $query) {
    // Check your model
    if ($widget->model instanceof \You\Plugin\Models\YourModel) {
        // extend $query
    }
}