backend.list.extendQuery
Provides an opportunity to modify and / or return the $query
object after the List widget has applied its scopes to it and before it's used to get the records.
$query
object after the List widget has applied its scopes to it and before it's used to get the records.Example usage:
Event::listen('backend.list.extendQuery', function ($listWidget, $query) {
$newQuery = MyModel::newQuery();
return $newQuery;
});
Or
$listWidget->bindEvent('list.extendQuery', function ($query) {
$query->whereNull('deleted_at');
});
Usage
Globally
use Event;
Event::listen('backend.list.extendQuery', function () {
// Your event listener code goes here...
});
Triggers
Class or file | Line |
---|---|
Backend\Widgets\Lists
|
593 |
Copyright © 2023 Winter CMS