@extends('layouts/contentLayoutMaster') @section('title', 'Dashboard Ecommerce') @section('vendor-style') {{-- vendor css files --}} @endsection @section('page-style') {{-- Page css files --}} @endsection @php $discountTypes = [ ['label' => 'Percentage', 'color' => '#24B094', 'width' => \App\Models\DiscountCode::whereType(\App\Enums\DiscountCode\TypeEnum::PERCENTAGE)->count()], ['label' => 'Fixed', 'color' => '#4E2775', 'width' => \App\Models\DiscountCode::whereType(\App\Enums\DiscountCode\TypeEnum::FIXED)->count()], //['label' => 'Category', 'color' => '#F8AB1B', 'width' => '55%'], //['label' => 'Product', 'color' => '#222245', 'width' => '35%'], ]; @endphp @section('content')
{{-- remove any @dd() before rendering --}} {{-- @dd($bestMonths) --}}

Total Orders

{{ number_format((int)\App\Models\Order::count()) }}

Highest Month {{ data_get($bestMonths, 'orders.label', '—') }}

{{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{-- --}} {{--
--}} {{--

Earnings

--}} {{--
--}} {{--

--}} {{-- --}} {{-- {{ number_format((float) \App\Models\Order::whereStatus(\App\Enums\Order\StatusEnum::DELIVERED)->sum('total_price')) }}--}} {{-- EGP--}} {{--

--}} {{--

--}} {{-- --}} {{-- Highest Month--}} {{-- {{ data_get($bestMonths, 'orders_revenue.label', '—') }}--}} {{--

--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}}

Visits

{{ number_format((int) \App\Models\Visit::count()) }}

Highest Month {{ data_get($bestMonths, 'visits.label', '—') }}

Refunded

{{ number_format((int) data_get($bestMonths, 'orders_refunded.value', \App\Models\Order::whereStatus(\App\Enums\Order\StatusEnum::REFUNDED)->count())) }}

Highest Month {{ data_get($bestMonths, 'orders_refunded.label', '—') }}

{{-- Products Card --}}

Products

{{ number_format((int) data_get($bestMonths, 'categories', 0)) }} Products
{{-- Templates Card --}}

Templates

Draft
{{ number_format((int) data_get($bestMonths, 'draft_templates', 0)) }} Templates
Published
{{ number_format((int) data_get($bestMonths, 'published_templates', 0)) }} Templates
Live
{{ number_format((int) data_get($bestMonths, 'live_templates', 0)) }} Templates
{{ number_format((int) data_get($bestMonths, 'templates', 0)) }} Templates
{{-- Products Card --}}

Categories

{{(int) data_get($bestMonths, 'products', 0)}} Categories

Sales

{{ number_format(data_get($bestMonths, 'orders_revenue.value'), 0) }} EGP

in {{ data_get($bestMonths, 'orders_revenue.ym') }}

Highest Month

{{ data_get($bestMonths, 'orders_revenue.label','—')}}

Lowest Month

{{ data_get($bestMonths, 'orders_revenue_lowest.label','—') }}

Visits

{{ number_format((int) \App\Models\Visit::count()) }} visits

{{-- in {{ $visitsCard['year'] }}--}}

Highest Month

{{data_get($bestMonths, 'visits.label','—') }}

Lowest Month

{{ data_get($bestMonths, 'visits_lowest.label','—') }}
{{--
--}} {{-- --}} {{--
--}} {{--
--}} {{--

Popular Products

--}} {{-- --}} {{--
--}} {{-- --}} {{--
--}} {{-- Product Image--}} {{--
--}} {{-- Product Name--}} {{-- In Stock: 25--}} {{-- Added: 2025-05-27--}} {{--
--}} {{--
--}} {{-- --}} {{--
--}} {{-- Sold: 500--}} {{-- Product Image--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{-- --}} {{--
--}} {{--
--}} {{--

Popular Templates

--}} {{-- --}} {{--
--}} {{-- --}} {{--
--}} {{-- Product Image--}} {{--
--}} {{--

Log Template

--}} {{--

Added: 2025-05-27

--}} {{--
--}} {{--
--}} {{-- --}} {{--
--}} {{-- Customized: 500--}} {{-- Product Image--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}}

Discount Codes

@foreach ($discountTypes as $type)
{{ $type['label'] }}
@endforeach
@foreach ($discountTypes as $type)
{{ $type['width'] }} Discount Code
@endforeach
{{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{-- --}} {{--
--}} {{--

Revenue

--}} {{--
--}} {{--
--}} {{--

Total earnings from orders used discount codes.

--}} {{--
--}} {{--

EGP

--}} {{-- in 2025--}} {{--
--}} {{--
--}} {{--

--}} {{-- Highest Month--}} {{--

--}} {{-- December--}} {{--
--}} {{--
--}} {{--

--}} {{-- Lowest Month--}} {{--

--}} {{-- March--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}}
@endsection @section('vendor-script') {{-- vendor files --}} @endsection @section('page-script') {{-- Page js files --}} @endsection