Support the ongoing development of Laravel.io →
Views Blade

I've created a master page for our site so that we maintain a similar layout throughout, but our home page is going to be slightly different from the rest of the site. For example, all of our pages will have a search bar on the navigation bar, where as the home page will have it displayed on the center of the page to make it stand out. Things like the breadcrumb and the title of the page will be on every other page except the home page. Aside from those things, everything will be the same (the header, footer, the buttons on the navigation bar, styling, etc.) So I was wondering, what would be a good way to approach this? I've considered adding "@yield" statements on the master page, but that would mean repeating the same code for similar pages. I've also considered giving the home page it's own master page, but that would also mean I would have to repeat a lot of code, such as the css and js links, the header, the footer, etc. What suggestions do you all have?

Last updated 3 years ago.
0

Two master pages one with the links js headers footers and other with the home one.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.