Laravel validate error

Add this below namespace:

use Illuminate\Support\Facades\Validator;

Can you please go to your app/config/app.php and check whether

Illuminate\Validation\ValidationServiceProvider

is available or not.
If not then just add this line and check if the problem is solved or not. Hope it will help you.


I believe that you probably have

use Illuminate\Validation\Validator;

in your file. (Your IDE probably thought it was being helpful.) To use the static :: call, Validator should be aliased to Illuminate\Support\Facades\Validator. (The \app\config\app.php file does this for you by default.)

Chances are good that changing the use statement to

use \Validator;

will fix things.

Tags:

Php

Laravel