@php $configData = Helper::appClasses(); $revenueGrowth = $lastMonthRevenue > 0 ? (($thisMonthRevenue - $lastMonthRevenue) / $lastMonthRevenue) * 100 : 0; $rentalGrowth = $lastMonthRentals > 0 ? (($thisMonthRentals - $lastMonthRentals) / $lastMonthRentals) * 100 : 0; @endphp @extends('layouts/layoutMaster') @section('title', 'Dashboard - Equipment Rental System') @section('vendor-style') @vite(['resources/assets/vendor/libs/apex-charts/apex-charts.scss']) @endsection @section('page-style') @vite(['resources/assets/vendor/scss/pages/cards-statistics.scss']) @endsection @section('vendor-script') @vite(['resources/assets/vendor/libs/apex-charts/apexcharts.js']) @endsection @section('page-script') @endsection @section('content')

Welcome back, {{ auth()->user()->name }}! 👋

Here's what's happening with your equipment rental business today.

@if(auth()->user()->hasPermission('rentals.create')) @endif
@if(auth()->user()->hasPermission('dashboard.total_rentals'))
@if ($rentalGrowth >= 0)

{{ number_format($rentalGrowth, 1) }}%

@else

{{ number_format(abs($rentalGrowth), 1) }}%

@endif
{{ number_format($totalRentals) }}

Total Rentals

{{ $thisMonthRentals }} this month
@endif @if(auth()->user()->hasPermission('dashboard.active_rentals'))
{{ number_format($activeRentals) }}

Active Rentals

{{ $returnedRentals }} returned
@endif @if(auth()->user()->hasPermission('dashboard.total_revenue'))
@if ($revenueGrowth >= 0)

{{ number_format($revenueGrowth, 1) }}%

@else

{{ number_format(abs($revenueGrowth), 1) }}%

@endif
Rs. {{ number_format($totalRevenue, 2) }}

Total Revenue

Rs. {{ number_format($thisMonthRevenue, 2) }} this month
@endif @if(auth()->user()->hasPermission('dashboard.today_revenue'))
Rs. {{ number_format($todayRevenue, 2) }}

Today's Revenue

{{ $todayRentals }} rentals today
@endif
{{ number_format($unpaidInvoices) }}

Unpaid Invoices

Rs. {{ number_format($unpaidAmount, 2) }}
@if(auth()->user()->hasPermission('dashboard.total_shops') || auth()->user()->hasPermission('shops.view'))
{{ number_format($totalShops) }}

Total Shops

{{ $isAdmin ? 'All locations' : 'Your shop' }}
@endif @if(auth()->user()->hasPermission('dashboard.total_equipment'))
{{ number_format($totalEquipments) }}

Total Equipment

In catalog
@endif @if(auth()->user()->hasPermission('dashboard.total_customers'))
{{ number_format($totalCustomers) }}

Total Customers

Registered
@endif @if(auth()->user()->hasPermission('dashboard.revenue_chart'))
Monthly Revenue Trend
@endif @if(auth()->user()->hasPermission('dashboard.status_chart'))
Rental Status
@endif @if(auth()->user()->hasPermission('dashboard.active_stock') && ($lowStockItems->count() > 0 || $outOfStockItems->count() > 0))
Stock Alerts
View All
@if ($outOfStockItems->count() > 0)
Out of Stock ({{ $outOfStockItems->count() }})
    @foreach ($outOfStockItems->take(5) as $stock)
  • {{ $stock->equipment->name }} @if ($isAdmin) - {{ $stock->shop->name }} @endif 0 available
  • @endforeach
@endif @if ($lowStockItems->count() > 0)
Low Stock ({{ $lowStockItems->count() }})
    @foreach ($lowStockItems->take(5) as $stock)
  • {{ $stock->equipment->name }} @if ($isAdmin) - {{ $stock->shop->name }} @endif {{ $stock->quantity - $stock->reserved }} available (threshold: {{ $stock->minimum_threshold }})
  • @endforeach
@endif
@endif @if(auth()->user()->hasPermission('dashboard.equipment_chart') && $equipmentUtilization->count() > 0)
Top Rented Equipment
@endif @if(auth()->user()->hasPermission('dashboard.daily_rentals_chart'))
Daily Rental Trends

Rentals and revenue over the last 14 days

@endif @if(auth()->user()->hasPermission('rentals.view'))
Recent Rentals
View All
@if ($isAdmin) @endif @forelse($recentRentals as $rental) @if ($isAdmin) @endif @empty @endforelse
Rental ID CustomerShopDate Amount Status
#{{ $rental->id }} {{ $rental->customer ? $rental->customer->name : 'Walk-in Customer' }} @if ($rental->customer && $rental->customer->phone)
{{ $rental->customer->phone }} @endif
{{ $rental->shop->name }}{{ \Carbon\Carbon::parse($rental->rental_date)->format('M d, Y') }} Rs. {{ number_format($rental->grand_total, 2) }} @if ($rental->status == 'active') Active @elseif($rental->status == 'returned') Returned @elseif($rental->status == 'cancelled') Cancelled @else {{ ucfirst($rental->status) }} @endif
No rentals found
@endif @if (auth()->user()->hasPermission('shops.view') && $isAdmin && $shopPerformance->count() > 0)
Shop Performance (This Month)

SHOP

REVENUE

    @foreach ($shopPerformance as $shop)
  • {{ $shop->name }}
    {{ $shop->rentals_count ?? 0 }} rentals
    Rs. {{ number_format($shop->rentals_sum_grand_total ?? 0, 2) }}
  • @endforeach
@endif
@endsection