Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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
Source by www.itsolutionstuff.com #
 
PREVIOUS NEXT
Tagged: #laravel #blade #variable #empty #optional
ADD COMMENT
Topic
Name
8+1 =