| Total Complexity | 4 |
| Total Lines | 53 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | trait BuildsQueries |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * Eager load relations. |
||
| 14 | * |
||
| 15 | * @param array|string $relations |
||
| 16 | * |
||
| 17 | * @return $this |
||
| 18 | */ |
||
| 19 | public function with($relations): self |
||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @return $this |
||
| 28 | */ |
||
| 29 | public function withTrashed(): self |
||
| 30 | { |
||
| 31 | $this->model = $this->model->withTrashed(); |
||
| 32 | |||
| 33 | return $this; |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Add sub-select queries to count the relations. |
||
| 38 | * |
||
| 39 | * @param mixed $relations |
||
| 40 | * |
||
| 41 | * @return $this |
||
| 42 | */ |
||
| 43 | public function withCount($relations): self |
||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Add an "order by" clause to the query. |
||
| 52 | * |
||
| 53 | * @param $column |
||
| 54 | * @param string $direction |
||
| 55 | * |
||
| 56 | * @return BuildsQueries |
||
| 57 | */ |
||
| 58 | public function orderBy($column, $direction = 'asc'): self |
||
| 65 |