for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Requests;
use JMS\Serializer\Annotation as JMS;
use Realshadow\RequestDeserializer\Contracts\RequestInterface;
class PaginatedRequest implements RequestInterface
{
/**
* @var int $page
*
* @JMS\Since("1.x")
* @JMS\Type("integer")
* @JMS\SerializedName("page")
*/
private $page;
* @var int $perPage
* @JMS\SerializedName("per_page")
private $perPage;
* @inheritdoc
public static function shouldValidate()
return true;
}
public static function getVersionConstraint()
return '1.0';
public function getSchema()
return resource_path('schemas/pagination.json');
* @return int
public function getPage()
return $this->page;
public function getPerPage()
return $this->perPage;
public function getOffset()
return ($this->page - 1) * $this->perPage;