Overwrite paginate method

parent 2d59e539
...@@ -13,6 +13,18 @@ use Modules\Page\Repositories\PageRepository; ...@@ -13,6 +13,18 @@ use Modules\Page\Repositories\PageRepository;
class EloquentPageRepository extends EloquentBaseRepository implements PageRepository class EloquentPageRepository extends EloquentBaseRepository implements PageRepository
{ {
/**
* @inheritdoc
*/
public function paginate($perPage = 15)
{
if (method_exists($this->model, 'translations')) {
return $this->model->with('translations')->orderBy('created_at', 'DESC')->paginate($perPage);
}
return $this->model->orderBy('created_at', 'DESC')->paginate($perPage);
}
/** /**
* Find the page set as homepage * Find the page set as homepage
* @return object * @return object
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment