| Conditions | 1 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 4 | ||
| Bugs | 1 | Features | 2 |
| 1 | <?php |
||
| 27 | public function getAllAuthor(array $filters): LengthAwarePaginator |
||
| 28 | { |
||
| 29 | /** @var User $data */ |
||
| 30 | $data = User::query()->withCount('posts'); |
||
| 31 | |||
| 32 | $data = $data->where('super_user', $filters['is_super']); |
||
| 33 | |||
| 34 | $data = $data->orderBy( |
||
| 35 | Arr::get($filters, 'order_by', 'posts_count'), |
||
| 36 | Arr::get($filters, 'order', 'desc') |
||
| 37 | ); |
||
| 38 | |||
| 39 | return $data->paginate($filters['per_page']); |
||
| 40 | } |
||
| 42 |