JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr{ gilour

File "LandingPageController.php"

Full Path: /home/markqprx/iniasli.pro/app-20260222054312/Http/Controllers/LandingPageController.php
File size: 1010 B
MIME-type: text/x-php
Charset: utf-8

<?php

namespace App\Http\Controllers;

use App\Models\Link;
use App\Models\LinkeableClick;
use App\Models\User;
use Common\Billing\Models\Product;
use Common\Core\BaseController;

class LandingPageController extends BaseController
{
    public function show()
    {
        return $this->renderClientOrApi([
            'pageName' => 'landing-page',
            'data' => [
                'loader' => 'landingPage',
                'stats' => $this->loadStats(),
                'products' => Product::with(['permissions', 'prices'])
                    ->limit(15)
                    ->orderBy('position', 'asc')
                    ->get(),
            ],
        ]);
    }

    public function stats()
    {
        return $this->success([
            'stats' => $this->loadStats(),
        ]);
    }

    protected function loadStats()
    {
        return [
            'links' => Link::count(),
            'clicks' => LinkeableClick::count(),
            'users' => User::count(),
        ];
    }
}