blade file in laravel code example

Example 1: laravel if syntax

@if (foo)
  // do something
@elseif (bar)
  // do something else
@else
  // do some other thing;
@endif

Example 2: laravel blade section keep template

<!-- Stored in resources/views/child.blade.php -->

@extends('layouts.app')

@section('title', 'Page Title')

@section('sidebar')
    @parent

    <p>This is appended to the master sidebar.</p>
@endsection

@section('content')
    <p>This is my body content.</p>
@endsection

Example 3: using get in laravel blade

{{ request()->has('faq') ? request()->get('faq') : '' }}

Example 4: how to open blade file from blade in laravel

cd /var/www/htmlmixed

Tags:

Php Example