How to check if isset condition in laravel blade?

Laravel 7

Nicesnippets

272

18-04-2020


Hello Dev,

Laravel blade template provide many types of directives. now if you have to check if isset condition in laravel blade then you have to use '@isset' directive. if you have to check variable isset or not then you can use this directives.

In PHP

if(isset($myVariable)){

return true

}

In Laravel Blade

@isset($myVariable)

// $myVariable is defined and is not null...

@endisset

I hope it can help you...