routes.php:
Route::get('/', 'MasterController@index'); Route::get('/', function () { return view('header'); }); Route::get('/', function () { return view('footer'); }); MasterController.php:
class MasterController extends Controller { public function index() { return view('master'); } header.blade.php:
@extends('master') @section('header') <h1> HEADER</h1> @endsection master.blade.php:
<body> <div id="header"> <h1> @yield('header')</h1> </div> <div id="footer"> @yield('footer') </div> </body> footer.php:
@extends('master') @section('footer') <h1>FOOTER</h1> @endsection the result should be two inscriptions "HEADER" and "FOOTER" ... so here it displays only "FOOTER" ... WHY so? In the routs they are equally spelled out then ...