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