app/Filters/BaseFilter.php
public function per_page($value)
    {
        $validator = validator([ 'value' => $value ], [ 'value' => 'numeric|min:1|max:1000' ]);
        return $this->builder->when(!$validator->fails(), function (Builder $query) use($value) {
            $model = $query->getModel();
            $model->setPerPage($value);
            $query->setModel($model);
        });
    }
public function per_page($value)
    {
        $validator = validator([ 'value' => $value ], [ 'value' => 'numeric|min:1|max:1000' ]);
        return $this->builder->when(!$validator->fails(), function (Builder $query) use($value) {
            $model = $query->getModel();
            $model->setPerPage($value);
            $query->setModel($model);
        });
    }
public function per_page ( $ value ) { $ validator = validator ( [ 'value' => $ value ] , [ 'value' => 'numeric|min:1|max:1000' ] ) ; return $ this -> builder -> when ( ! $ validator -> fails ( ) , function ( Builder $ query ) use ( $ value ) { $ model = $ query -> getModel ( ) ; $ model -> setPerPage ( $ value ) ; $ query -> setModel ( $ model ) ; } ) ; }
Total per page on pagination
@param  int $value
@return \Illuminate\Database\Eloquent\Builder
Total per page on pagination