You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. I have try to implement your repository pattern in my project. it was succesfully run. But in latest project. I have an error as i write in this issue tittle
I recommend you create another method from the interface that will implement pagination. For example,
from EloquentRepositoryInterface.php
interface EloquentRepositoryInterafce
{
// ... other methods
public function withPagination(int $pages): Collection;
}
BaseRepository.php
class BaseRepository implements EloquentRepositoryInterface
{
// ... other methods
public function withPagination(int $pages): Collection
{
return $this->model->paginate($pages)->all();
}
}
I hope this helps you. Sorry for the late response.
Activity
elhakimdev commentedon Mar 11, 2021
Im try to apply paginated data when call method all() in this repository
carlomigueldy commentedon Mar 13, 2021
Hi @elhakimdev , can you show me your code on where you experienced this error?
carlomigueldy commentedon Mar 13, 2021
I recommend you create another method from the interface that will implement pagination. For example,
from EloquentRepositoryInterface.php
BaseRepository.php
I hope this helps you. Sorry for the late response.
elhakimdev commentedon May 23, 2021
Okey.thanks for your repplies. I wass youre comment now. Let me try and check again about your recommendation.
Sorry for late response. But great thanks for your explanations. Better thanks regard elhakim dev
carlomigueldy commentedon Jun 26, 2021
Happy to help!
elhakimdev commentedon Jun 26, 2021