1234567891011121314151617181920212223242526272829 |
- <?php
- namespace App\Repositories;
- use App\Models\PlatformContent;
- use Symfony\Component\HttpKernel\Exception\HttpException;
- /**
- * Created by PhpStorm.
- * User: durong
- * Date: 2019/6/17
- * Time: 下午6:46
- */
- class PlatformContentRepository
- {
- public function __construct(PlatformContent $platformContent)
- {
- $this->platformContent = $platformContent;
- }
- public function index($request)
- {
- $perPage = isset($request['per_page']) ? $request['per_page'] : env('PER_PAGE');
- $this->platformContent = $this->platformContent
- ->orderBy('id', 'desc');
- return $this->platformContent->paginate($perPage);
- }
- }
|