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

31 lines
779 B
PHP

<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
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;
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;
}
}