From the course: Laravel Essential Training
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Add a create method and view to show a form - Laravel Tutorial
From the course: Laravel Essential Training
Add a create method and view to show a form
Our users should be able to quickly add a new note. So right here in the notes page, above all notes, let's add a link to create a new note that will take the user to a form. We will be using a few more buttons and other pages as well. So let's create a button component and reuse it. If you go to resources, views, components, we actually already have a button component which is primary button and a secondary button. But this uses button type equals submit. What we need is actually a link button. That is a link that looks like the button. We can reuse this styles though. So let me copy all of this. Create a new component and call it link-button.blade.php. and paste it here and replace this button with a instead. Yeah, a, and then the href will be merged. We have to remove type equal submit and just keep the class. So all of these styles will be applied. Now open the index blade view and add this component at the top before displaying the notes. You can do so using the x-link button…
Contents
-
-
-
-
-
-
(Locked)
Add an index method to fetch all notes5m 19s
-
(Locked)
Create an index view to display all notes5m 31s
-
(Locked)
Add pagination and clean up the index view4m 53s
-
(Locked)
Add a create method and view to show a form9m 42s
-
(Locked)
Add a store action to save the data7m 21s
-
(Locked)
Add a show action and view to display single note6m 40s
-
(Locked)
Create a unique ID for each note3m 50s
-
(Locked)
Challenge: Add index and create methods for a new resource53s
-
(Locked)
Solution: Add index and create methods for a new resource4m 46s
-
(Locked)
-
-
-
-