ClearBowl/api/app/Http/Controllers/Controller.php

31 lines
779 B
PHP
Raw Permalink Normal View History

2019-11-16 20:37:33 +01:00
<?php
namespace App\Http\Controllers;
2019-12-15 21:09:14 +01:00
use Illuminate\Http\Request;
2019-11-16 20:37:33 +01:00
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;
class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
2019-12-15 21:09:14 +01:00
private $paginationSize = 10;
protected function getFilters(Request $request){
$filters = ['limit' => $this->paginationSize];
if($request->has('limit')){
$filters['limit'] = $request->query('limit');
}
if($request->has('search')){
$filters['search'] = $request->query('search');
}
return $filters;
}
2019-11-16 20:37:33 +01:00
}