Answers for "laravel blade variable isset, empty or optional"

PHP
0

laravel blade variable isset, empty or optional

// laravel optional parameter
{{ $variable ?? 'empty or write some message' }}
{{ $data ?? ' ' }}

// laravel variable is set or not
@isset($variable)
  // do some stuff when varaibale have value
@endisset
  
  // laravel varaible empty or not
  @empty ($variable)
  // do some stuff when varaibale have empty value
  @endempty
Posted by: Guest on May-26-2021

Browse Popular Code Answers by Language