Laravel- Including header footer in Blade Template:
Laravel Including: add header, footer and another page use @include() in the blade template. In a web page have many common pages so these pages do not create twice. Including common pages in your Laravel project.
Hello friends, thank you to visit this page. In this tutorial, I will help you to connect header, footer and other common pages on a single page in your web application. If you need the partition of common pages and include other location in your project file so, this tutorial will help you to do this. You will find solutions to this problem very quickly and you can use it in your web application.
Laravel Blade template including PHP files: if you use blade template for you Laravel web application so, this tutorial will more helpful for you. Here you will see a simple approach to include pages in blade template. For example:
Include Common Page:
<div> <!-- header --> @include('admin_panel.common_pages.header') </div> <div> <!-- footer --> @include('admin_panel.common_pages.footer') </div>
If your project common pages are from another directory or folder, then what will you do. I have an example for you to solve this problem. You can include more subfile, which in a project directory. That’s like you common page path is resources\views\common_pages\ header.blade.php. you have to follow this example that in the below of this texts.
Example:
<div class="main-content"> <!-- header --> @include('admin_panel.common_pages.header') <!-- sidebar --> @include('admin_panel.common_pages.sidebar') </div>
I think this tutorial will helpful for you if you using blade template for you Laravel web application and include common pages. We have more tutorial, which Laravel and blade template related if you want you can follow our website.