How to include header file in laravel

You can include a partial header file using @include() directive in laravel blade file

Answers 1
  • Include partial header file in laravel view

    <div class="header">
        <a href="#default" class="logo">CompanyLogo</a>
        <div class="header-right">
            <a class="active" href="#home">Home</a>
            <a href="#contact">Contact</a>
            <a href="#about">About</a>

    Create the partial view file which you want to include in laravel view. Benefit of a partial header file is that you don’t have to use the header code again and again in different view files. You just have to use @include(‘path.file’) in the file and it's also useful in case you want to make changes because you just have to make changes in this particular partial header file instead of all files.

  • Back to code snippet queries related laravel