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.

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

Triggers

Class or file Line
Backend\Widgets\Lists 599
Copyright © 2024 Winter CMS