CorpusRepository.php 316 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace App\Repositories;
  3. use App\Models\Corpus;
  4. class CorpusRepository {
  5. protected $corpus;
  6. public function __construct(Corpus $corpus)
  7. {
  8. $this->corpus = $corpus;
  9. }
  10. public function getAndPaginate($n)
  11. {
  12. return $this->corpus
  13. ->orderBy('corpora.created_at', 'desc')
  14. ->paginate($n);
  15. }
  16. }