Replies: 1 comment 4 replies
-
|
Ok, managed to solve it. You have to go into route-attributes.php and add the needed Middlewares to make it work. Question: is this really the way it should work? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey,
i want to use this excellent package for my current project, where i am currently testing out some ideas.
What i encountered is, that this package currently does not work when using it with FormRequest Validators.
Steps to reproduce.
Fresh Laravel Installation
create a model
create a controller
create a request object
install spatie/laravel-route-attributes package
create a get and a post route in the controller
validate data in post action request
output form errors
the view looks like this:
and for example the text helper looks like this
The problem here is, that $errors are always not present.
As soon as i remove the package, they will be outputted again
Laravel Version: 8.46.0
PHP Version: 8.0.7
Any hints how to get it to work? am i missing something?
EDIT:
When setting enabled to false and registrating the routes by myself in the web.php file, the validation works as expected.
EDIT 2:
Also using $this->validate inside the controller action does not work.
So currently with your package outputting validation errors is not possible.
Beta Was this translation helpful? Give feedback.
All reactions