This repository was archived by the owner on Nov 4, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +30
-14
lines changed Expand file tree Collapse file tree 2 files changed +30
-14
lines changed Original file line number Diff line number Diff line change @@ -205,4 +205,34 @@ public function from($offset)
205205
206206 return $ this ;
207207 }
208+
209+ /**
210+ * @inheritdoc
211+ */
212+ public function get ()
213+ {
214+ $ collection = parent ::get ();
215+
216+ if (isset ($ this ->with ) && $ collection ->count () > 0 ) {
217+ $ collection ->load ($ this ->with );
218+ }
219+
220+ return $ collection ;
221+ }
222+
223+ /**
224+ * @inheritdoc
225+ */
226+ public function paginate ($ perPage = null , $ pageName = 'page ' , $ page = null )
227+ {
228+ $ paginator = parent ::paginate ($ perPage , $ pageName , $ page );
229+
230+ if (isset ($ this ->with ) && $ paginator ->total () > 0 ) {
231+ $ paginator
232+ ->getCollection ()
233+ ->load ($ this ->with );
234+ }
235+
236+ return $ paginator ;
237+ }
208238}
Original file line number Diff line number Diff line change @@ -225,18 +225,4 @@ public function getTotalCount($results)
225225 {
226226 return $ results ['hits ' ]['total ' ];
227227 }
228-
229- /**
230- * @inheritdoc
231- */
232- public function get (Builder $ builder )
233- {
234- $ collection = parent ::get ($ builder );
235-
236- if (isset ($ builder ->with ) && $ collection ->count () > 0 ) {
237- $ collection ->load ($ builder ->with );
238- }
239-
240- return $ collection ;
241- }
242228}
You can’t perform that action at this time.
0 commit comments