@extends('admin.layouts.master') @section('title', 'Dashboard') @section('css') @endsection @section('content')

Dashboard

Good Morning, {{ auth()->user()->first_name }} {{ auth()->user()->last_name }}!

Here's what's happening with your store.

@if (auth()->user()->role_id == 3 || auth()->user()->role_id == 1)

Total Orders

@php $allOrdersCount = 0; if (auth()->user()->role_id == 3) { $allOrdersCount = \App\Models\Order::where( 'packer_id', auth()->user()->id, )->whereIn('status', ['packing', 'packed']) ->get() ->count(); } else { $allOrdersCount = \App\Models\Order::all()->count(); } $allOrdersRoute = '#'; if (auth()->user()->role_id == 3) { $allOrdersRoute = route('packer.order.index'); } else { $allOrdersRoute = route('admin.order.index'); } @endphp

{{ $allOrdersCount }}

View all orders

Packing Orders

@php $packingOrdersCount = 0; if (auth()->user()->role_id == 3) { $packingOrdersCount = \App\Models\Order::where( 'packer_id', auth()->user()->id, ) ->where('status', 'packing') ->get() ->count(); } else { $packingOrdersCount = \App\Models\Order::where('status', 'packing') ->get() ->count(); } $packingOrdersRoute = '#'; if (auth()->user()->role_id == 3) { $packingOrdersRoute = route('packer.order.index', [ 'status' => 'packing', ]); } else { $packingOrdersRoute = route('admin.order.packing'); } @endphp

{{ $packingOrdersCount }}

View packing orders

Packed Orders

@php $packedOrdersCount = 0; if (auth()->user()->role_id == 3) { $packedOrdersCount = \App\Models\Order::where( 'packer_id', auth()->user()->id, ) ->where('status', 'packed') ->get() ->count(); } else { $packedOrdersCount = \App\Models\Order::where('status', 'packed') ->get() ->count(); } $packedOrdersRoute = '#'; if (auth()->user()->role_id == 3) { $packedOrdersRoute = route('packer.order.index', [ 'status' => 'packed', ]); } else { $packedOrdersRoute = route('admin.order.index', ['status' => 'packed']); } @endphp

{{ $packedOrdersCount }}

View packing orders
@endif @if (auth()->user()->role_id == 1)

Pending Orders

{{ \App\Models\Order::where('status', 'pending')->count() }}

View Pending orders
@endif
@if (auth()->user()->role_id == 1)

Total Customers

{{ \App\Models\User::where('role_id', 2)->get()->count() }}

View all customers

Active Customers

{{ \App\Models\User::where('role_id', 2)->where('status', 'active')->get()->count() }}

View Active Customers

Blocked Customers

{{ \App\Models\User::where('role_id', 2)->where('status', 'blocked')->get()->count() }}

View blocked customers

Total Packers

{{ \App\Models\User::where('role_id', 3)->get()->count() }}

View all packers

Total Enquiries

{{ \App\Models\Contact::all()->count() }}

View all Enquiries

Answered Enquiries

{{ \App\Models\Contact::where('status', 'answered')->count() }}

View Answered Enquiries

UnAnswered Enquiries

{{ \App\Models\Contact::where('status', 'unanswered')->count() }}

View UnAnswered Enquiries

Total Pickup Addresses

{{ \App\Models\PickupAddress::all()->count() }}

View all PickupAddresses

Total Categories

{{ \App\Models\Category::all()->count() }}

View All Categories

Total Products

{{ \App\Models\Product::all()->count() }}

View all Products

Total Sliders

{{ \App\Models\Slider::all()->count() }}

View all Sliders

Total Testimonials

{{ \App\Models\Testimonial::all()->count() }}

View all Testimonials

Performa Invoices

{{ \App\Models\Order::where('status', 'performa_invoice')->count() }}

all Performa Invoices
@endif
@endsection @section('js') @endsection