-
Book Overview & Buying
-
Table Of Contents
Laravel 5.x Cookbook
By :
The previous work did not cover validation. We could check for comic, and then check that the user is the owner. What I will do here is show how to use Form Request Validation to validate the incoming request.
If you have been following along, you have the app/Http/Controllers/FavoriteCreate.php controller in place, so we are going to add validation to it.
Add toastr so that we can notify people as needed (https://github.com/Foxandxss/angular-toastr); you will see in the next layout that I had to move several files from the bower_components/angular-toastr to the public/js and public/css folders.
I also install the Angular animate:
>bower install angular-toastr#0.4.1 -S
Add it to resources/views/layout.blade.php:

Add it at the bottom of the file as well:

Register it with the app called public/js/app.js:

Then, add it to our handle error area:

Let's make the form called request:
>php artisan make:request FavoriteCreateRequest
Then, add what...