Gorakh Nath Timilsina
Gorakh Nath Timilsina

Reputation: 477

Method [validate] does not exist

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

Upvotes: 0

Views: 1330

Answers (1)

user1669496
user1669496

Reputation: 33058

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.

Upvotes: 4

Related Questions