Blade Basic

Blade Basic

As we know we can send the data from route to view using {{ }} – curly braces that is blade syntax. As we know blade is a template engine that make easier to work with data and logic inside of php.

Some Basic Blade syntax

If we use if statement in Laravel then first of all we have to use @ sign, then if.

For Example

@if()

@elseif()

@else

@endif

If you want to use vanilla php in Laravel then also use @sign in starting

For Example

@php

                $age=20;

                echo “your age is “. $age;

 @endphp

Post Your Comments & Reviews

Your email address will not be published. Required fields are marked *

*

*