for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Yaro\Jarboe\Http\Controllers\Traits\Handlers;
use Yaro\Jarboe\Table\CRUD;
trait PerPageHandlerTrait
{
/**
* Handle setting per page param.
*
* @param $perPage
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function perPage($perPage)
$this->beforeInit();
$this->init();
$this->bound();
$this->crud()->setPerPageParam((int) $perPage);
return redirect($this->crud()->listUrl());
}
abstract protected function beforeInit();
abstract protected function init();
abstract protected function bound();
abstract protected function crud(): CRUD;