StarNewsRepository.php 532 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace App\Repositories;
  3. use App\Models\StarNews;
  4. use Dingo\Api\Http\Response;
  5. use Symfony\Component\HttpKernel\Exception\HttpException;
  6. /**
  7. * Created by PhpStorm.
  8. * User: durong
  9. * Date: 2019/6/17
  10. * Time: 下午18:59
  11. */
  12. class StarNewsRepository
  13. {
  14. public function __construct(StarNews $starNews)
  15. {
  16. $this->starNews = $starNews;
  17. }
  18. public function index($request)
  19. {
  20. $this->starNews = $this->starNews
  21. ->orderBy('id', 'desc')->get();
  22. return $this->starNews;
  23. }
  24. }