<?php

namespace App\Http\Controllers\Backend;

use Illuminate\View\View;
use App\Models\CRM\Company;
use Illuminate\Http\Request;
use App\Models\CRM\Individual;
use App\Models\INSURANCE\Insurer;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;

class DashboardController extends Controller
{
    public function index(): View
    {
        return view('dashboard');
    }



    public function crm(): View
    {
        $individuals = Individual::latest()->take(10)->get();
        $companies = Company::latest()->take(10)->get();
        return view('backend.crm.dashboard', compact('individuals', 'companies'));
    }

    public function osiguranje(): View
    {
        $insurers = Insurer::orderBy('short_name', 'asc')->get();
        return view('backend.insurance.dashboard', compact('insurers'));
    }
}
