Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

dmytroshved's avatar

Laravel Blade: Components Structure for Layout

Hey everyone, I am refactoring my structure of blade components

My layout.blade.php file is assembled from several parts: header and footer, and each of these components is also broken down into sub-components (nav-item, logo...)

I have a question: which structuring practice and folder hierarchy would be more preferable in the future for expanding the site, and which structure will be easily readable and free of excessive nesting and confusion?

In my project there is a lot of different components and I would like to place everything logically and clear

Will it be okay to place everything in one folder?

components/
    layout/
        index.blade.php            # <x-layout>
        menus/
            desktop.blade.php      # <x-layout.menus.desktop>
            mobile.blade.php       # <x-layout.menus.mobile>
        footer/
            index.blade.php        # <x-layout.footer>
            nav.blade.php          # <x-layout.footer.nav>
            quote.blade.php        # <x-layout.footer.quote>
            logo.blade.php         # <x-layout.footer.logo>
        header/
            index.blade.php        # <x-layout.header>
            nav.blade.php

Or should I place layout.blade.php in the root directory?

components/
layout.blade.php            # <x-layout>
    menus/
        desktop.blade.php      # <x-menus.desktop>
         mobile.blade.php       # <x-.menus.mobile>
    footer/
         index.blade.php        # <x-footer>
         nav.blade.php          # <x-footer.nav>
         quote.blade.php        # <x-footer.quote>
         logo.blade.php         # <x-footer.logo>
     header/
         index.blade.php        # <x-.header>
         nav.blade.php

Would be grateful for your help

Best regards

0 likes
1 reply
vincent15000's avatar

I would say that you are free to structure the folder according to what is best for you.

1 like

Please or to participate in this conversation.