@extends(‘layout’) – display page from resources/view/layout.blade.php
@include(‘navbar’) – include the file from resources/view/navbar.blade.php
@yield(‘content’) – read data from “section”
@section(‘content’) – register section for contect @yield(‘content’)
@endsection
Use yield & section to pass data
Passing page Title
@section(‘title’)
Welcome HomePage
@endsection
or you can use: @section(‘title’, ‘Welcome Homepage’)
Passing Data between files
Route::get(‘/’, function () {
$tasks = [
‘Go to the store’,
‘Go to the market’,
‘Go to work’ ];
return view(‘index’, [
‘tasks’ => $tasks ]
);
to load the data on a different page
<ul>
@foreach ($tasks as $task)
<li>{{ $task }}</li>
@endforeach
</ul>