You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to validate the input of user from the service. I am following a service repository pattern here. So I have created a Validator for the users input I have added it to the Service class but I get an error on Postman when trying to post data.
Error
"message": "Argument 1 passed to App\\Services\\UserService::saveUser() must be an instance of App\\Requests\\UserStoreRequest, instance of Dingo\\Api\\Http\\Request given, called in C:\\laragon\\www\\nextserver\\app\\Http\\Controllers\\Api\\UserController.php on line 28",
Actual Behaviour
I am trying to validate the input of user from the service. I am following a service repository pattern here. So I have created a Validator for the users input I have added it to the Service class but I get an error on Postman when trying to post data.
Error
"message": "Argument 1 passed to App\\Services\\UserService::saveUser() must be an instance of App\\Requests\\UserStoreRequest, instance of Dingo\\Api\\Http\\Request given, called in C:\\laragon\\www\\nextserver\\app\\Http\\Controllers\\Api\\UserController.php on line 28",
Controller
Request / Validation Class
Service Class
How do I fix this issue?
The text was updated successfully, but these errors were encountered: