@foreach($data as $barcode) @php $first_image_of_barcode = DB::table('barcode_images') ->where('barcode_id', $barcode->item_code) ->where('barcode_image_active', 1) ->first(); if($first_image_of_barcode){ $first_image_of_barcode = $first_image_of_barcode->file_path; } else { $first_image_of_barcode = 'default.png'; } @endphp @endforeach
Barcode ID Old Code Description Gold Weight Diamond Weight Purchase Cost Image
{{$barcode->item_code}} {{$barcode->old_code}} {{$barcode->description}} {{$barcode->gold_weight}} {{$barcode->diamond_weight}} {{$barcode->purchase_cost}} Barcode Image