| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | private function load() |
||
| 35 | { |
||
| 36 | if ($this->userId) { |
||
| 37 | $userScope = fn ($builder) => $builder->where('user_id', $this->userId); |
||
| 38 | |||
| 39 | $this->guideRepository->pushCriteria( |
||
| 40 | new EagerLoading([ |
||
| 41 | 'subscribers' => $userScope, |
||
| 42 | 'voters' => $userScope, |
||
| 43 | 'roles' => $userScope |
||
| 44 | ]) |
||
| 45 | ); |
||
| 46 | } |
||
| 47 | |||
| 48 | $paginator = $this->guideRepository->paginate(); |
||
| 49 | |||
| 50 | return $this->view('guide.home', [ |
||
| 51 | 'pagination' => GuideResource::collection($paginator)->response()->getData(true) |
||
| 52 | ]); |
||
| 55 |