for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace App\Http\Requests\Api\User;
use Illuminate\Foundation\Http\FormRequest;
final class IndexRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize(): bool
return true;
}
* Get the validation rules that apply to the request.
* @return array
public function rules(): array
return [
'name' => ['sometimes', 'string', 'max:191'],
'email' => ['sometimes', 'string', 'max:191'],
'sortBy' => ['sometimes', 'string', 'in:name,email'],
'desc' => ['sometimes', 'boolean'],
'perPage' => ['sometimes', 'integer', 'min:1', 'max:100'],
];