@extends('dashboard.layout') @section('content')

Service Requests

{{ $serviceRequestsCount }}

Total requests

Active Projects

{{ $projectsCount }}

In progress

Total Invoices

{{ $invoicesCount }}

All invoices

Transactions

{{ $transactionsCount }}

Payment history

Recent Service Requests

View All
@forelse(auth()->user()->serviceRequests()->latest()->take(3)->get() as $request)

{{ $request->businessType->name ?? 'Service Request' }}

Submitted on {{ $request->created_at->format('M j, Y') }}

@php $statusColors = [ 'pending' => 'bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-300', 'in_progress' => 'bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300', 'approved' => 'bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300', 'cancelled' => 'bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300' ]; $statusLabels = [ 'pending' => 'Pending', 'in_progress' => 'In Progress', 'approved' => 'Completed', 'cancelled' => 'Cancelled' ]; @endphp {{ $statusLabels[$request->status] }}
Amount: {{ number_format($request->total_price, 2) }} SR
@empty

No service requests found

@endforelse

Active Projects

View All
@forelse(auth()->user()->projects()->latest()->take(2)->get() as $project)

{{ $project->project_name }}

@php $progressPercentage = $project->total_amount > 0 ? ($project->paid_amount / $project->total_amount) * 100 : 0; @endphp {{ number_format($progressPercentage, 0) }}%
Started: {{ $project->start_date?->format('M j, Y') ?? 'N/A' }} Due: {{ $project->deadline?->format('M j, Y') ?? 'N/A' }}
Paid: {{ number_format($project->paid_amount, 2) }} SR Due: {{ number_format($project->due_amount, 2) }} SR
@empty

No active projects

@endforelse

Recent Invoices

View All
@forelse(auth()->user()->invoices()->latest()->take(2)->get() as $invoice)

{{ $invoice->invoice_number }}

{{ number_format($invoice->amount, 2) }} SR
{{ $invoice->project->project_name ?? 'General Invoice' }} @php $invoiceStatusColors = [ 'paid' => 'bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300', 'pending' => 'bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-300', 'overdue' => 'bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300', ]; @endphp {{ ucfirst($invoice->status) }}
@if($invoice->due_date)
Due: {{ $invoice->due_date->format('M j, Y') }}
@endif
@empty

No invoices found

@endforelse

Recent Transactions

View All
@forelse(auth()->user()->transactions()->latest()->take(3)->get() as $transaction)

{{ $transaction->transaction_id ?? 'N/A' }}

{{ number_format($transaction->amount, 2) }} SR

{{ ucfirst(str_replace('_', ' ', $transaction->payment_method)) }}

{{ $transaction->payment_date }}
@empty

No transactions found

@endforelse
@endsection