@if(isset($data)) @foreach($data as $key=>$value) @if($value->fuel_qty && $value->fuel_qty > 0) @elseif($value->other_fuel_types) @php $types = explode(',', $value->other_fuel_types); // Split the string into an array $trimmedTypes = array_map('trim', $types); // Trim whitespace from each value $uniqueTypes = array_unique($trimmedTypes); // Get unique values $uniqueTypesString = implode(',', $uniqueTypes); // Concatenate back into a comma-separated string @endphp @else @endif @endforeach @endif
Department Name Fuel Consumption Quantity Fuel Type
@if($value->department!=null) {{$value->department}} @else -- @endif @if($value->fuel_qty!=null) {{$value->fuel_qty}} @else -- @endif {{$value->fuel_type}} {{$uniqueTypesString}} --