Skip to content

Commit

Permalink
Merge pull request #596 from Laravel-Backpack/add-setQuery()-method-t…
Browse files Browse the repository at this point in the history
…o-api

Add set query() method to api
  • Loading branch information
pxpm authored Sep 5, 2024
2 parents 7a19c91 + 1d59e2a commit 0060806
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions 6.x/crud-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,10 @@ $this->crud->limit();
```php
$this->crud->orderBy();
```
- **setQuery(Builder $query)** - replaces the query with the new provided query.
```php
$this->crud->setQuery(User::where('status', 'active'));
```

<a name="show-api"></a>
### Show Operation
Expand Down
2 changes: 2 additions & 0 deletions 6.x/crud-operation-list-entries.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@ public function setupLast12MonthsView()
}
```

**NOTE:** The `CustomView` will apply the query "on top" of the current `$crud->query`. If you would like to use a "fresh query" for your custom view you can use the `CRUD::setQuery()` method that will overwrite the previous set query.

<a name="widget"></a>
## How to add custom sections (aka. Widgets)

Expand Down

0 comments on commit 0060806

Please sign in to comment.