You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 2, 2020. It is now read-only.
Clear previously set statements in Laravel query builder/Eloqent builder easily.
3
+
4
+
## Features
5
+
- Support most of query builder statemets. (where, limit, order etc..)
6
+
- Intuitive, just type ->reset{..} followed by the statement name like: resetLimit()
7
+
- Well tested (check tests folder).
8
+
- Easy to use ..
9
+
10
+
11
+
## Install
12
+
13
+
Via Composer
14
+
```bash
15
+
composer require awssat/laravel-query-test
16
+
```
17
+
18
+
### Before Laravel 5.5
19
+
You'll need to manually register `Awssat\QueryReset\QueryResetServiceProvider::class` service provider in `config/app.php`.
20
+
21
+
## Usage
22
+
| Query\Builder method | Description |
23
+
| --- | --- |
24
+
| resetOrder() | remove all `order by ...` statements from the query |
25
+
| resetLimit() | remove all `limit ...` statements from the query |
26
+
| resetOffset() | remove all `offset ...` statements from the query |
27
+
| resetHaving() | remove all `having ...` statements from the query |
28
+
| resetWhere() | remove all `where ...` statements from the query |
29
+
| resetSelect() | remove all `select ...` statements from the query |
30
+
| resetJoin() | remove all `join ...` statements from the query |
31
+
| resetDistinct() | remove all `distinct ...` statements from the query |
32
+
| resetGroup() | remove all `group by ...` statements from the query |
33
+
| resetAggregate() | remove all aggregate's methods statements from the query such as `count`, `max`, `min`, `avg`, and `sum`. |
34
+
35
+
| Eloquent\Builder method | Description |
36
+
| --- | --- |
37
+
| resetWith() or resetEagerLoad() | remove all eager Loads |
38
+
| resetScopes() | remove all restrictive scopes |
39
+
40
+
41
+
### Examples
42
+
```php
43
+
$model->orderBy('id')->resetOrder()
44
+
```
45
+
46
+
```php
47
+
$model->with('items')->resetWith()
48
+
```
49
+
50
+
## Usage case
51
+
if you're using statements in your relations defining methods or using built in laravel realtions that's using statement by default such as `order by` or a model's scope that interfere with your query ... and you don't want that for a specific query call .. use this package.
52
+
53
+
54
+
55
+
## License
56
+
57
+
This package is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).
0 commit comments