# Laravel custom request route parameters validation
Override the `validationData()` function to apply validation rules to the **URL parameters**.
```php=
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class DateRangeRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'start_date' => 'required|date_format:Y-m-d',
'end_date' => 'required|date_format:Y-m-d|after_or_equal:start_date'
];
}
/**
* Use route parameters for validation.
* @return array
*/
public function validationData()
{
return $this->route()->parameters();
}
}
```
###### tags: `Laravel` `Request`