0

Method validate does not exit. I tried to validate my form values as shown in the figure. But it give me this error. Please tell me . I am new to laravel. [User controller

Error

1
  • Have you tried adding use Validator; to the top of your controller? Commented Apr 6, 2016 at 16:23

1 Answer 1

4

You aren't extending the correct Controller.

class UserController extends Controller { ... } 

Controller then extends BaseController.

If you open up Controller which resides in the same namespace as your other controllers, you will see it uses the trait ValidatesRequests which is what provides the validate method.

You can also remove the line use Illuminate\Routing\Controller as BaseController;. There should be no reason to import that.

Sign up to request clarification or add additional context in comments.

1 Comment

Actually it is not working on my Laravel 5.4.36. I am extending the Controller for my RegisterController.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.