<?php

namespace App\Http\Controllers\AdminPanel;

use App\Http\Controllers\Controller;
use App\Models\CarOwner;
use App\Models\CarWashOwner;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\View;

class AdminController extends Controller
{


    public function index(Request $request)
    {

        $data['page_title'] = "Dashboard";
        $data['page_sub_title'] = "Statistics Overview";
        $data['home_url'] = route('admin.dashboard');
        View::share('data', $data);

        $data['cards'] = $this->card_data();
        // dd($data);
        return view('admin.dashboard', $data);
    }

    protected function card_data()
    {
        $cwo_count = CarWashOwner::count();
        $co_count = CarOwner::count();

        $card_data = [
            [
                'title' => 'Car Wash Owners',
                'count' => $cwo_count,
                'icon' => 'icon-truck'
            ],
            [
                'title' => 'Car Owners',
                'count' => $co_count,
                'icon' => 'icon-users'
            ],
            // [
            //     'title'=>'R Total Revenue Generated',
            //     'count' => 100,
            //     'icon'=>'icon-users'

            // ],
            // [
            //     'title'=>'Total Cars Washed Today',
            //     'count' => 100
            // ],
            // [
            //     'title'=>'Total Cars Washed This Month',
            //     'count' => 100
            // ],
            // [
            //     'title'=>'Total Cars Washed This Year',
            //     'count' => 100
            // ],

        ];

        return $card_data;
    }
}
