PHP Geek PHP Geek - 2 months ago 11x
PHP Question

Extending the header and footer in laravel

I am using laravel 5.2 to create a new project. As i am new in the laravel. so I am creating new page and directory structure is as follows:
- layouts
- default.blade.php
- page
- index.blade.php
- templates -common
- header.blade.php
- footer.blade.php

Now in page/index.blade.php I need to extend the default layout. my codes are as below..


and in index page i have defined the section but resulting the error as follows:

FatalErrorException in 1d36838b56f16e2e06a8567cdd5270af26ec6aa8.php line 1: syntax error, unexpected '__data' (T_STRING)

Please suggest me some solutions....
Thank you


in your structure templates - header.blade.php - footer.blade.php no directory common in templates, which is in


Also check you have at first line in index.php: @extends('layouts.default')