Closed bbauti closed 8 months ago
You've defined the route in routes/api.php
, Inertia isn't an API library like Axios, it's a router. The API would most likely be stateless and doesn't have the Inertia middleware. You should define your route as a web
route in routes/web.php
Oh. I thought that it should be in the apis routes, I never thought that it should go on the web ones. Thank you very much!
I'm trying to submit a form with the inertia form helper, so far I've always done it with axios but I want to learn how to use the helper. The problem is that, when I send the post request, the controller does not validate. If I submit the form, the controller creates the new category, if I send with an empty input, it doesn't create it, but if I send with a character, or a number, or things that a should trigger the validation, it also creates it. What could be the problem?
Edit: now it doesnt create the category even if its valid
I started the proyect with Jetstream
I have this code:
CategoriesController.php
NewCategory.vue
routes/api.php