checking variable is null in laravel blade file

Solution:1

You can either use

null coalescing operator: {{ $material_details ?? 'second value' }}

or elvis operator: {{ $material_details ?: 'default value' }} (checks given value is empty or null)

Read on Elvis and Null coalescing operator.

Links:

Elvis: https://en.wikipedia.org/wiki/Elvis_operator

Null coalescing operator: https://en.wikipedia.org/wiki/Null_coalescing_operator

Solution:2

Try following code.

@if(is_null($material_details))
    // whatever you need to do here
@else 

Solution:3

Try this

@if(isset($material_details->pricing))
 <tr>
   <td>NOT NULL</td>
 </tr>
@else
 <tr>
   <td>NULL</td>
 </tr>
@endif

Or this

@if(empty($material_details->pricing))
 <tr>
   <td>NULL</td>
 </tr>
@else
 <tr>
   <td>NOT NULL</td>
 </tr>
@endif