<?php

namespace App\Http\Controllers\Leasing;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;

class DashboardController extends Controller
{
    public function index()
    {
        $profile = auth()->user()->leasingProfile;

        $stats = [
            'total_branches' => $profile->branches()->count(),
            'total_records' => $profile->records()->count(),
            'total_uploads' => $profile->uploads()->count(),
            'active_subscription' => auth()->user()->subscriptions()->where('subscription_status', 'active')->first(),
        ];

        return view('leasing.dashboard', compact('stats'));
    }
}
