How can I capture the result of the form validation from the controller and display it in the vue view?
I have the Store method in the CategoryController controller that is responsible for validating and entering the data to the db, I need to pass the result of the validation to the view, which is if characters, numbers or blank spaces were entered, so that this way you can then pass the data to the table using Axios.
Any ideas? I'm using Laravel 5.6 and Vuejs 2
You must improve the question and provide more elements to give concrete answers and not ramble. From what I could understand you want to send validation alerts from the controller to the view; This way I perform my validations and send errors to the view:
Code in the view:
I hope it helps you!
you pass it to vue like this and that's it:
where
$variable
is a variable that you pass from your controller