# Refactor the layout component

Now that we have our components, it's time to refactor the layout

  • Let's refactor the footer component and add some extra information, but only for local development:
    • Show the current breakpoint from Tailwind
    • Add some quick links for PhpMyAdmin, MailHog (a local mailserver for development) and links to the TALL stack websites
  • Create a new folder resources/views/components/layout/footer
  • Move the file resources/views/components/layout/footer.blade.php to the folder footer and rename the file to index.blade.php
  • Create a new icon component inside the component's folder: resources/views/components/layout/footer/icon.blade.php
    resources

WARNING

  • If the footer is not rendered correctly, you have to clear the cached files in the storage/framework/views/ folder
  • Execute the following command in the terminal: php artisan view:clear
  • Reload the page

# x-cloak

  • Every time a page is loaded, the debug icons are visible for a split second
  • Alpine's x-cloak (opens new window) directive can be used to hide the icons until the page is fully loaded
  • For x-cloak to work however, we must add extra styling to our resources/css/app.css file
  • Let's refactor the navbar component and use some off the Jetstream components and our newly created logo component
  • Open resources/views/components/layout/nav.blade.php and replace it with the following code:

REMARKS

  • Because we don't have all the pages yet, most of the links in our navbar refer to the home page route('home') instead of the actual page
Last Updated: 10/19/2022, 12:06:26 PM