@extends('admin.adminmaster') @section('title') Admin-Products @endsection @section('content') @section('heading') Products @endsection
@if (session('product_msg')) @if (session('product_msg') == 'true')
@else @endif @endif {{-- Add New Product


--}}
View Products
@foreach ($products as $product) @endforeach
ID Name Code Discount Price Image Action
{{ $product['id'] }} {{ $product['name'] }} {{ $product['code'] }} @if($product['discount']>0){{ $product['discount'] }}%@else N/A @endif ${{ $product['final_price'] }} @php $rating = 0; $reviewCount = count($product->getReviews); foreach ($product->getReviews as $review) { $rating += $review->stars; // Assuming `star` is the attribute that stores the rating (e.g., 3, 4, or 5). } if ($rating > 0) { $rating = $rating / sizeof($product->getReviews); } @endphp {{round( $rating,1) }} stars | | |
@section('script') @endsection @endsection