laravel: where is $request->validate() defined?

raw

README.rst

  • vendor/laravel/framework/src/Illuminate/Http/Request.php - IlluminateHttpRequest::validate() does not exist
class Request extends SymfonyRequest implements Arrayable, ArrayAccess
{
    use Concerns\InteractsWithContentTypes,
        Concerns\InteractsWithFlashData,
        Concerns\InteractsWithInput,
        Macroable;

Neither SymfonyRequest nor the traits have a validate() method.

But Macroable defines __call and __callStatic, so probably from there. Can't dump $request because too large -> link to blogpost

$ ack 'equest::macro'
vendor/laravel/framework/src/Illuminate/Foundation/Providers/FoundationServiceProvider.php
38:        Request::macro('validate', function (array $rules, ...$params) {
Christian Weiske Christian Weiske
owner

History