PlatformContentRepository.php 567 B

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