This video is all about storing data. Don’t worry it’s easy!
When storing data, we generally follow these steps
1. Validate the data
2. Store it in database
3. Redirect to either show() or index()
Validation is super easy in Laravel 5. We simply need to use the validate function. Link below to see all of the validation rules available to us.
With Laravel 5.6 validation we can simply pass in the rules and Laravel handles the rest. It will automatically redirect us back to the previous page with errors in the session flash.
We can safely write code under the validate() method and know that all data has passed validation. To enter something in our database we simply create a new Post object and then add the data into that object and finally submit it to the database with the save() method on that object.
facebook page
/ slchutibro
#laravel #laravel_auth #laravelAuth #Auth #laravelInsert #laravel_insert #laravel_validation #laravel_sinhalen #laravelsinhalen #chutibro #lonelytraveller #nipunsamintha #nipun_samintha #srilanka