title
Laravel From Scratch [Part 7] - Forms & Saving Data

description
In this video we will be creating a form using Laravel Collective to submit blog posts to the database. CODE: Complete Code For This Series https://github.com/bradtraversy/lsapp 10 PROJECT LARAVEL COURSE: Please use affiliate link below https://www.eduonix.com/affiliates/id/16-10485 50% OFF: Use special code "traversy" SUPPORT: We spend massive amounts of time creating these free videos, please donate to show your support: http://www.paypal.me/traversymedia http://www.patreon.com/traversymedia FOLLOW TRAVERSY MEDIA: http://www.facebook.com/traversymedia http://www.twitter.com/traversymedia http://www.linkedin.com/in/bradtraversy

detail
{'title': 'Laravel From Scratch [Part 7] - Forms & Saving Data', 'heatmap': [{'end': 477.084, 'start': 450.391, 'weight': 0.842}, {'end': 536.876, 'start': 498.434, 'weight': 0.733}, {'end': 694.591, 'start': 657.04, 'weight': 0.857}, {'end': 922.756, 'start': 894.772, 'weight': 0.848}], 'summary': 'Tutorial covers creating a post form in laravel using laravel collective, configuring form actions, and creating a bootstrap layout for form creation. it includes setting up validation, implementing an editor, and saving posts with a focus on view handling, validation, and using ckeditor.', 'chapters': [{'end': 228.333, 'segs': [{'end': 61.271, 'src': 'embed', 'start': 0.506, 'weight': 0, 'content': [{'end': 2.987, 'text': 'hey guys, welcome back to Laravel from scratch.', 'start': 0.506, 'duration': 2.481}, {'end': 10.13, 'text': 'in this video I want to start to create the the form to actually add, add a post through our application.', 'start': 2.987, 'duration': 7.143}, {'end': 18.773, 'text': 'so if we go to slash posts, slash create, that should load the create function inside the post controller.', 'start': 10.13, 'duration': 8.643}, {'end': 22.655, 'text': "so let's go there and you can see there's nothing here.", 'start': 18.773, 'duration': 3.882}, {'end': 25.356, 'text': "so it's just loading a blank page.", 'start': 22.655, 'duration': 2.701}, {'end': 27.457, 'text': 'what we want to do is load up a view.', 'start': 25.356, 'duration': 2.101}, {'end': 38.238, 'text': "so we'll say return, it's going to be in the post folder and then it's going to be in a template called create.", 'start': 27.457, 'duration': 10.781}, {'end': 38.638, 'text': 'all right.', 'start': 38.238, 'duration': 0.4}, {'end': 42.879, 'text': "so let's go ahead and save that and we'll go to our views and then post folder.", 'start': 38.638, 'duration': 4.241}, {'end': 51.102, 'text': "oops, and let's say new file, create dot, blade, dot, php, all right.", 'start': 42.879, 'duration': 8.223}, {'end': 61.271, 'text': "and then i'm just going to copy what we have in the index And let's see, for the H1, we're just going to say create post.", 'start': 51.102, 'duration': 10.169}], 'summary': "Creating the form to add a post in laravel, loading 'create' function, and adding a view for post creation.", 'duration': 60.765, 'max_score': 0.506, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-QapNzUE4V0/pics/-QapNzUE4V0506.jpg'}, {'end': 160.986, 'src': 'embed', 'start': 128.16, 'weight': 3, 'content': [{'end': 130.201, 'text': 'And then we can include certain components.', 'start': 128.16, 'duration': 2.041}, {'end': 135.362, 'text': 'So if we look at right here, we can include labels like this.', 'start': 131.221, 'duration': 4.141}, {'end': 142.243, 'text': 'And then for the inputs, we can do form text and just pass in whatever we want to call that.', 'start': 136.062, 'duration': 6.181}, {'end': 146.944, 'text': 'Passwords and check boxes, select groups, all that stuff.', 'start': 143.143, 'duration': 3.801}, {'end': 148.564, 'text': 'Anything that you can do with a form.', 'start': 146.984, 'duration': 1.58}, {'end': 152.325, 'text': 'And then it also includes cross-site protection.', 'start': 149.304, 'duration': 3.021}, {'end': 160.986, 'text': "So it's going to include a CSRF input that's going to protect us from people trying to submit from other places.", 'start': 152.885, 'duration': 8.101}], 'summary': 'The discussion covers including labels, form inputs, and cross-site protection, such as csrf input, to safeguard against unauthorized submissions.', 'duration': 32.826, 'max_score': 128.16, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-QapNzUE4V0/pics/-QapNzUE4V0128160.jpg'}, {'end': 205.28, 'src': 'embed', 'start': 177.74, 'weight': 4, 'content': [{'end': 180.662, 'text': "And we'll go over here and open up our terminal.", 'start': 177.74, 'duration': 2.922}, {'end': 181.763, 'text': "Let's clear this out.", 'start': 180.842, 'duration': 0.921}, {'end': 184.545, 'text': "We'll paste that in.", 'start': 183.705, 'duration': 0.84}, {'end': 187.087, 'text': "And that'll install it.", 'start': 186.167, 'duration': 0.92}, {'end': 190.752, 'text': 'Now, we do need to add some things to the config.', 'start': 187.85, 'duration': 2.902}, {'end': 195.034, 'text': "Usually when you install a Laravel package, you'll have to add it as a provider.", 'start': 191.132, 'duration': 3.902}, {'end': 198.216, 'text': "And if it has any aliases, you'll have to add those.", 'start': 195.835, 'duration': 2.381}, {'end': 205.28, 'text': "So let's just copy this one line right here and then go to our config folder in app.php.", 'start': 198.356, 'duration': 6.924}], 'summary': 'Installing laravel package by adding provider and aliases to the config.', 'duration': 27.54, 'max_score': 177.74, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-QapNzUE4V0/pics/-QapNzUE4V0177740.jpg'}], 'start': 0.506, 'title': 'Creating post form in laravel and using laravel collective for html forms', 'summary': 'Discusses creating a form to add a post through the application and using laravel collective for html forms in laravel 5.0, including installation, form element syntax, and cross-site protection, with a focus on the setup process and configuration in app.php.', 'chapters': [{'end': 61.271, 'start': 0.506, 'title': 'Creating post form in laravel', 'summary': 'Discusses creating a form to add a post through the application, by loading the create function inside the post controller and creating a template called create in the post folder.', 'duration': 60.765, 'highlights': ['The chapter focuses on creating a form to add a post through the application.', 'Loading the create function inside the post controller is discussed.', 'The process of creating a template called create in the post folder is explained.']}, {'end': 228.333, 'start': 61.992, 'title': 'Using laravel collective for html forms', 'summary': 'Discusses using laravel collective for html forms in laravel 5.0 and on, including installation with composer, syntax for creating form elements, and adding cross-site protection, demonstrating the setup process and configuration in app.php.', 'duration': 166.341, 'highlights': ['Laravel Collective provides a syntax for creating form elements such as labels, inputs for text, passwords, checkboxes, select groups, and includes cross-site protection. Laravel Collective offers a convenient syntax for creating various form elements, including labels, text inputs, passwords, checkboxes, and select groups, while also incorporating cross-site protection for secure form submissions.', 'The chapter demonstrates the installation of Laravel Collective using Composer and the addition of providers and aliases in the configuration file (app.php). The chapter details the installation process of Laravel Collective using Composer and the necessary configuration steps, including adding providers and aliases in the app.php file.']}], 'duration': 227.827, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-QapNzUE4V0/pics/-QapNzUE4V0506.jpg', 'highlights': ['The chapter focuses on creating a form to add a post through the application.', 'Loading the create function inside the post controller is discussed.', 'The process of creating a template called create in the post folder is explained.', 'Laravel Collective provides a syntax for creating form elements such as labels, inputs for text, passwords, checkboxes, select groups, and includes cross-site protection.', 'The chapter demonstrates the installation of Laravel Collective using Composer and the addition of providers and aliases in the configuration file (app.php).', 'Laravel Collective offers a convenient syntax for creating various form elements, including labels, text inputs, passwords, checkboxes, and select groups, while also incorporating cross-site protection for secure form submissions.']}, {'end': 511.317, 'segs': [{'end': 351.487, 'src': 'embed', 'start': 230.174, 'weight': 0, 'content': [{'end': 232.016, 'text': 'And now we should be all set to use it.', 'start': 230.174, 'duration': 1.842}, {'end': 234.237, 'text': "So let's close up that config file.", 'start': 232.156, 'duration': 2.081}, {'end': 237.299, 'text': "And let's go back to the documentation.", 'start': 235.217, 'duration': 2.082}, {'end': 241.321, 'text': "And we're just going to grab this right here.", 'start': 238.739, 'duration': 2.582}, {'end': 248.987, 'text': "And then let's go to our view, which is our create.blade and paste that in there.", 'start': 243.126, 'duration': 5.861}, {'end': 260.329, 'text': "Now, instead of using URL here, I mean, you could do that, but we're going to use action.", 'start': 254.029, 'duration': 6.3}, {'end': 263.091, 'text': "So we're going to put an array and we're going to say action.", 'start': 260.35, 'duration': 2.741}, {'end': 271.784, 'text': 'And set that to the controller function, which is going to be post controller.', 'start': 265.339, 'duration': 6.445}, {'end': 274.106, 'text': "And then we're going to do at store.", 'start': 272.525, 'duration': 1.581}, {'end': 276.388, 'text': "Store is the function we're submitting to.", 'start': 274.647, 'duration': 1.741}, {'end': 279.551, 'text': 'And then we just need to describe the method.', 'start': 276.828, 'duration': 2.723}, {'end': 281.933, 'text': 'And this bracket should go over here.', 'start': 280.431, 'duration': 1.502}, {'end': 290.279, 'text': "So we'll put a comma here and then the method, which is going to be post.", 'start': 284.074, 'duration': 6.205}, {'end': 292.061, 'text': 'All right.', 'start': 291.841, 'duration': 0.22}, {'end': 301.606, 'text': "And we're using Bootstrap, so I'm going to put a div in here with the class of form group.", 'start': 293.804, 'duration': 7.802}, {'end': 313.968, 'text': "And in here, we're going to put our label, so we can do our double curly braces and do form double colon label.", 'start': 306.527, 'duration': 7.441}, {'end': 318.549, 'text': 'And in here, this is going to be a label for title.', 'start': 316.469, 'duration': 2.08}, {'end': 321.95, 'text': 'And then the actual text, which will be title.', 'start': 319.809, 'duration': 2.141}, {'end': 324.361, 'text': 'with an uppercase T.', 'start': 322.54, 'duration': 1.821}, {'end': 335.13, 'text': "And then for the input or the text input, we'll do form, text, and we're going to pass in the name for this, which will be title.", 'start': 324.361, 'duration': 10.769}, {'end': 340.478, 'text': 'Okay, and then the second parameter is the value.', 'start': 337.776, 'duration': 2.702}, {'end': 345.182, 'text': "This is going to be a create form, so we don't want a value, so we'll have just a blank string.", 'start': 340.618, 'duration': 4.564}, {'end': 348.345, 'text': 'And then we can add attributes inside of this array.', 'start': 345.702, 'duration': 2.643}, {'end': 351.487, 'text': "So let's say we want to add a class onto this text field.", 'start': 348.485, 'duration': 3.002}], 'summary': 'Configuring and implementing form submission with laravel and bootstrap in a controller function, method, and attributes.', 'duration': 121.313, 'max_score': 230.174, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-QapNzUE4V0/pics/-QapNzUE4V0230174.jpg'}, {'end': 477.084, 'src': 'heatmap', 'start': 447.068, 'weight': 4, 'content': [{'end': 450.371, 'text': "OK, that's going to be the value and then we have some attributes we can add.", 'start': 447.068, 'duration': 3.303}, {'end': 458.537, 'text': "We're going to add class and let's make that BTN and then BTN primary.", 'start': 450.391, 'duration': 8.146}, {'end': 460.959, 'text': 'OK, and that should do it.', 'start': 458.557, 'duration': 2.402}, {'end': 464.482, 'text': "So there's our form.", 'start': 463.541, 'duration': 0.941}, {'end': 467.585, 'text': "Now, when we submit, it's going to make a post request to store.", 'start': 464.542, 'duration': 3.043}, {'end': 470.207, 'text': "So let's go over here and go to our store.", 'start': 468.125, 'duration': 2.082}, {'end': 477.084, 'text': 'Now validation in Laravel is very, very simple.', 'start': 473.942, 'duration': 3.142}], 'summary': 'Creating a form with attributes btn and btn primary. laravel validation is simple.', 'duration': 30.016, 'max_score': 447.068, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-QapNzUE4V0/pics/-QapNzUE4V0447068.jpg'}], 'start': 230.174, 'title': 'Configuring form and bootstrap form creation', 'summary': 'Explains configuring form action in laravel by setting the controller function to post controller at store, using the post method, and updating the create.blade view. it also discusses creating a basic crud application using bootstrap for form layout and laravel for simple validation, with a focus on creating input fields for title and body, including text and textarea elements, and adding a submit button with validation rules for title and body.', 'chapters': [{'end': 292.061, 'start': 230.174, 'title': 'Configuring form action in laravel', 'summary': 'Explains how to configure form action in laravel by setting the controller function to post controller at store, using the post method, and updating the create.blade view.', 'duration': 61.887, 'highlights': ['Setting the controller function to post controller at store.', 'Using the post method for form submission.', 'Updating the create.blade view with the form action configuration.']}, {'end': 511.317, 'start': 293.804, 'title': 'Bootstrap form creation', 'summary': 'Discusses creating a basic crud application using bootstrap for form layout and laravel for simple validation, with a focus on creating input fields for title and body, including text and textarea elements, and adding a submit button with validation rules for title and body.', 'duration': 217.513, 'highlights': ['Creating input fields for title and body The chapter covers the process of creating input fields for title and body, including using text and textarea elements, and adding attributes like class and placeholder.', 'Adding a submit button with validation rules The chapter demonstrates adding a submit button with classes and validation rules for title and body fields, showcasing the simplicity of validation in Laravel.', 'Using Bootstrap for form layout The usage of Bootstrap for form layout is highlighted, with the addition of form groups and classes like form-control and btn-primary for styling.']}], 'duration': 281.143, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-QapNzUE4V0/pics/-QapNzUE4V0230174.jpg', 'highlights': ['Setting the controller function to post controller at store.', 'Using the post method for form submission.', 'Updating the create.blade view with the form action configuration.', 'Creating input fields for title and body, including using text and textarea elements.', 'Adding a submit button with classes and validation rules for title and body fields.', 'Usage of Bootstrap for form layout, including form groups and classes like form-control and btn-primary for styling.']}, {'end': 1132.869, 'segs': [{'end': 558.088, 'src': 'embed', 'start': 511.317, 'weight': 0, 'content': [{'end': 518.299, 'text': "So let's go back and we're going to go back to our form and let's submit and you'll see that it's not letting us.", 'start': 511.317, 'duration': 6.982}, {'end': 521.541, 'text': 'If I enter the stuff in here and submit, now it does.', 'start': 518.6, 'duration': 2.941}, {'end': 524.202, 'text': 'Alright, now we want some messaging here.', 'start': 522.221, 'duration': 1.981}, {'end': 536.876, 'text': "and what I'll do is go to our views folder and in the includes we're going to create a file called messages.blade.php.", 'start': 525.422, 'duration': 11.454}, {'end': 540.26, 'text': 'alright, and then in here we basically have three things we want to check.', 'start': 536.876, 'duration': 3.384}, {'end': 547.545, 'text': "we want to check the errors array that's created when we, when we fail validation.", 'start': 540.26, 'duration': 7.285}, {'end': 553.007, 'text': 'We also want to check for session values, so session success and then session error.', 'start': 548.246, 'duration': 4.761}, {'end': 558.088, 'text': 'And those are going to be flash messages that we can create at any point.', 'start': 554.047, 'duration': 4.041}], 'summary': 'Creating a messages file to handle error and success messages for form submissions.', 'duration': 46.771, 'max_score': 511.317, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-QapNzUE4V0/pics/-QapNzUE4V0511317.jpg'}, {'end': 694.591, 'src': 'heatmap', 'start': 657.04, 'weight': 0.857, 'content': [{'end': 658.901, 'text': 'And then this to error.', 'start': 657.04, 'duration': 1.861}, {'end': 663.383, 'text': 'Alright, and you can use this messages file in all your projects.', 'start': 658.921, 'duration': 4.462}, {'end': 665.944, 'text': 'So we just need to include it in our main layout.', 'start': 663.703, 'duration': 2.241}, {'end': 671.087, 'text': "So let's go in the container right above the content here.", 'start': 666.565, 'duration': 4.522}, {'end': 683.242, 'text': "and we're just going to do include, so include and that's going to be in the inc folder.", 'start': 674.095, 'duration': 9.147}, {'end': 685.544, 'text': 'and then messages all right.', 'start': 683.242, 'duration': 2.302}, {'end': 691.448, 'text': "so let's go ahead and save that and go back and reload and submit, and now we get our error messages.", 'start': 685.544, 'duration': 5.904}, {'end': 694.591, 'text': "if i put the title in, it's just going to tell us the body.", 'start': 691.448, 'duration': 3.143}], 'summary': 'Incorporate messages file in main layout, resulting in error messages on form submission.', 'duration': 37.551, 'max_score': 657.04, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-QapNzUE4V0/pics/-QapNzUE4V0657040.jpg'}, {'end': 726.865, 'src': 'embed', 'start': 694.591, 'weight': 4, 'content': [{'end': 699.248, 'text': "if i put that in, it's going to submit, okay, And it's as easy as that.", 'start': 694.591, 'duration': 4.657}, {'end': 701.353, 'text': "It's very, very simple to add validation.", 'start': 699.288, 'duration': 2.065}, {'end': 704.22, 'text': 'You can see validation, pagination.', 'start': 702.015, 'duration': 2.205}, {'end': 706.166, 'text': 'This stuff is really easy with Laravel.', 'start': 704.361, 'duration': 1.805}, {'end': 707.048, 'text': "It's very elegant.", 'start': 706.206, 'duration': 0.842}, {'end': 712.195, 'text': "so let's go back to our post controller and finish our store function.", 'start': 708.032, 'duration': 4.163}, {'end': 715.657, 'text': 'now, remember, we use tinker and we inserted our stuff into the database.', 'start': 712.195, 'duration': 3.462}, {'end': 718.379, 'text': 'we can do the same exact thing here, all right.', 'start': 715.657, 'duration': 2.722}, {'end': 726.865, 'text': "so let's say create post, and this is going to be post equals new post.", 'start': 718.379, 'duration': 8.486}], 'summary': 'Adding validation and pagination with laravel is simple and elegant.', 'duration': 32.274, 'max_score': 694.591, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-QapNzUE4V0/pics/-QapNzUE4V0694591.jpg'}, {'end': 775.687, 'src': 'embed', 'start': 739.574, 'weight': 5, 'content': [{'end': 750.202, 'text': "So we'll say post title, set that to we're going to set it to request and then input and then title.", 'start': 739.574, 'duration': 10.628}, {'end': 751.943, 'text': 'All right.', 'start': 751.663, 'duration': 0.28}, {'end': 754.665, 'text': 'This will get whatever is submitted into the form.', 'start': 752.063, 'duration': 2.602}, {'end': 757.127, 'text': 'We want to do the same thing for the body.', 'start': 755.246, 'duration': 1.881}, {'end': 762.251, 'text': 'OK, so this will be post body.', 'start': 757.147, 'duration': 5.104}, {'end': 766.214, 'text': 'Set this right here to body as well.', 'start': 764.112, 'duration': 2.102}, {'end': 770.104, 'text': 'And then we want to save it.', 'start': 768.583, 'duration': 1.521}, {'end': 771.825, 'text': "So we'll just say post save.", 'start': 770.164, 'duration': 1.661}, {'end': 775.687, 'text': "And then we'll just redirect.", 'start': 774.406, 'duration': 1.281}], 'summary': 'Setting post title and body to request input, then saving and redirecting.', 'duration': 36.113, 'max_score': 739.574, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-QapNzUE4V0/pics/-QapNzUE4V0739574.jpg'}, {'end': 934.907, 'src': 'heatmap', 'start': 894.772, 'weight': 1, 'content': [{'end': 898.759, 'text': "That's going to go to slash post slash create.", 'start': 894.772, 'duration': 3.987}, {'end': 904.778, 'text': 'Okay, so now we have a link to create our post.', 'start': 902.475, 'duration': 2.303}, {'end': 908.262, 'text': "So I guess we'll go ahead and implement the editor.", 'start': 905.699, 'duration': 2.563}, {'end': 910.664, 'text': "I wasn't going to yet, but we will.", 'start': 908.322, 'duration': 2.342}, {'end': 913.387, 'text': "So let's say laravel-ck-editor.", 'start': 910.704, 'duration': 2.683}, {'end': 922.756, 'text': 'Right here, Unisharp Laravel CK Editor.', 'start': 920.014, 'duration': 2.742}, {'end': 925.439, 'text': 'So we need to install this with Composer.', 'start': 923.657, 'duration': 1.782}, {'end': 927.46, 'text': "So let's grab this right here.", 'start': 926.299, 'duration': 1.161}, {'end': 931.083, 'text': "And we'll go over and open up our terminal.", 'start': 928.902, 'duration': 2.181}, {'end': 932.545, 'text': "Let's clear this out.", 'start': 931.103, 'duration': 1.442}, {'end': 934.907, 'text': 'Paste that in, run it.', 'start': 933.786, 'duration': 1.121}], 'summary': 'Implementing unisharp laravel ck editor using composer.', 'duration': 81.937, 'max_score': 894.772, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-QapNzUE4V0/pics/-QapNzUE4V0894772.jpg'}, {'end': 1128.319, 'src': 'embed', 'start': 1100.983, 'weight': 7, 'content': [{'end': 1106.425, 'text': "which is what we're looking at if we're just using these double curly braces, it's not going to parse the HTML.", 'start': 1100.983, 'duration': 5.442}, {'end': 1115.048, 'text': "So with the body, what we want to do is use one curly brace and then two exclamation marks, and that'll actually parse the HTML.", 'start': 1106.485, 'duration': 8.563}, {'end': 1118.209, 'text': "So let's save that and we'll go back and reload.", 'start': 1115.088, 'duration': 3.121}, {'end': 1121.19, 'text': "And now you can see that it's actually parsing it.", 'start': 1118.689, 'duration': 2.501}, {'end': 1124.631, 'text': "There's no paragraph tags showing and we have our bold text.", 'start': 1121.25, 'duration': 3.381}, {'end': 1128.319, 'text': "All right, so it's as easy as that to implement an editor.", 'start': 1125.612, 'duration': 2.707}], 'summary': 'Using two exclamation marks within a curly brace parses html, as demonstrated in the example.', 'duration': 27.336, 'max_score': 1100.983, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-QapNzUE4V0/pics/-QapNzUE4V01100983.jpg'}], 'start': 511.317, 'title': 'Laravel views and validation', 'summary': 'Covers creating a messages.blade.php file in the views folder to handle errors and success messages, adding validation, implementing an editor, creating and saving posts, ordering posts, adding links, installing and using a ckeditor, and ensuring html parsing in the body.', 'chapters': [{'end': 663.383, 'start': 511.317, 'title': 'Creating message handling in laravel views', 'summary': 'Explains how to create a messages.blade.php file in the views folder to handle errors and success messages in laravel, including checking for errors in the errors array and displaying flash messages for success and error using session values.', 'duration': 152.066, 'highlights': ['Creating a messages.blade.php file in the views folder to handle errors and success messages The chapter explains the process of creating a messages.blade.php file in the views folder to handle errors and success messages in Laravel.', 'Checking for errors in the errors array The chapter emphasizes the importance of checking the errors array created during validation and using conditional statements to handle error messaging.', 'Displaying flash messages for success and error using session values The chapter demonstrates the usage of session values to display flash messages for success and error, providing a structured approach for handling different types of messages in Laravel.']}, {'end': 1132.869, 'start': 663.703, 'title': 'Adding validation and implementing editor', 'summary': 'Demonstrates adding validation and implementing an editor in laravel. it covers adding error messages, creating and saving posts, ordering posts, adding links, installing and using a ckeditor, and ensuring html parsing in the body.', 'duration': 469.166, 'highlights': ['Implementing CKEditor The chapter installs and implements the Unisharp Laravel CKEditor by adding it with Composer, updating the app.php file, publishing the assets, and using the CKEditor on specified text areas.', 'Adding Validation and Error Messages The process of adding validation and error messages is explained, demonstrating the ease of adding validation and displaying error messages when submitting forms.', 'Creating and Saving Posts The steps for creating and saving posts are detailed, including creating a new post object, setting title and body from form inputs, saving the post, and redirecting to the posts page with a success message.', "Ordering Posts The chapter shows how to order posts by 'created at' and provides instructions for adding a link to create a post in the navbar.", 'Ensuring HTML Parsing in the Body The importance of using one curly brace and two exclamation marks to parse HTML in the body of posts is emphasized, ensuring proper rendering of HTML content.']}], 'duration': 621.552, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-QapNzUE4V0/pics/-QapNzUE4V0511317.jpg', 'highlights': ['Creating a messages.blade.php file in the views folder to handle errors and success messages in Laravel.', 'Implementing CKEditor by adding it with Composer, updating the app.php file, publishing the assets, and using the CKEditor on specified text areas.', 'Checking for errors in the errors array created during validation and using conditional statements to handle error messaging.', 'Displaying flash messages for success and error using session values, providing a structured approach for handling different types of messages in Laravel.', 'Adding validation and error messages, demonstrating the ease of adding validation and displaying error messages when submitting forms.', 'Creating and saving posts, including creating a new post object, setting title and body from form inputs, saving the post, and redirecting to the posts page with a success message.', "Ordering posts by 'created at' and providing instructions for adding a link to create a post in the navbar.", 'Ensuring HTML parsing in the body of posts by using one curly brace and two exclamation marks to parse HTML content.']}], 'highlights': ['The chapter focuses on creating a form to add a post through the application.', 'Loading the create function inside the post controller is discussed.', 'The process of creating a template called create in the post folder is explained.', 'Laravel Collective provides a syntax for creating form elements such as labels, inputs for text, passwords, checkboxes, select groups, and includes cross-site protection.', 'The chapter demonstrates the installation of Laravel Collective using Composer and the addition of providers and aliases in the configuration file (app.php).', 'Laravel Collective offers a convenient syntax for creating various form elements, including labels, text inputs, passwords, checkboxes, and select groups, while also incorporating cross-site protection for secure form submissions.', 'Setting the controller function to post controller at store.', 'Using the post method for form submission.', 'Updating the create.blade view with the form action configuration.', 'Creating input fields for title and body, including using text and textarea elements.', 'Adding a submit button with classes and validation rules for title and body fields.', 'Usage of Bootstrap for form layout, including form groups and classes like form-control and btn-primary for styling.', 'Creating a messages.blade.php file in the views folder to handle errors and success messages in Laravel.', 'Implementing CKEditor by adding it with Composer, updating the app.php file, publishing the assets, and using the CKEditor on specified text areas.', 'Checking for errors in the errors array created during validation and using conditional statements to handle error messaging.', 'Displaying flash messages for success and error using session values, providing a structured approach for handling different types of messages in Laravel.', 'Adding validation and error messages, demonstrating the ease of adding validation and displaying error messages when submitting forms.', 'Creating and saving posts, including creating a new post object, setting title and body from form inputs, saving the post, and redirecting to the posts page with a success message.', "Ordering posts by 'created at' and providing instructions for adding a link to create a post in the navbar.", 'Ensuring HTML parsing in the body of posts by using one curly brace and two exclamation marks to parse HTML content.']}