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

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