<?php

namespace App\Http\Controllers\Admin;

use App\Models\Admin\Page;
use App\Models\Admin\User;
use App\Models\Admin\Banner;
use App\Models\Admin\Language;
use App\Http\Controllers\Controller;
use App\Models\Admin\Popup;

class DashboardController extends Controller
{
    public function index()
    {
        $total = [
            'pages' => [
                'title' => 'SAYFA', 'count' => Page::count(), 'max' => Page::count() * 2, 'percentage' => Page::count() * 1.5,
            ],
            'banners' => [
                'title' => 'BANNER', 'count' => Banner::count(), 'max' => Banner::count() * 2, 'percentage' => Banner::count() * 1.5,
            ],
            'popups' => [
                'title' => 'POP-UP', 'count' => Popup::count(), 'max' => Popup::count() * 2, 'percentage' => Popup::count() * 1.5,
            ],
            'users' => [
                'title' => 'KULLANICI', 'count' => User::count(), 'max' => User::count() * 2, 'percentage' => User::count() * 1.5,
            ],
            'languages' => [
                'title' => 'AKTİF DİL', 'count' => Language::where('status', 1)->count(), 'max' => Language::where('status', 1)->count() * 2, 'percentage' => Language::where('status', 1)->count() * 1.5,
            ]
        ];

        return view('admin.dashboard.index', [
            'total' => $total,
        ]);
    }
}
