@php $featured = App\Models\Product::where('featured',1)->orderBy('id','DESC')->limit(6)->get(); @endphp

Featured Products

@foreach ($featured as $product) @php $discountPersentage = ($product->discount_price/$product->selling_price) * 100; $discount = $product->selling_price - $product->discount_price; @endphp
@if ($product->discount_price == NULL) New @else Save {{round($discountPersentage)}}% @endif

{{$product->product_name}}

{{--
--}}
@if ($product->discount_price == NULL) ${{$product->selling_price}} @else ${{$discount}} ${{$product->selling_price}} @endif
{{--
--}} {{-- Add To Cart --}}
@endforeach