init
Some checks failed
Tests / PHP 8.2 (push) Has been cancelled
Tests / PHP 8.3 (push) Has been cancelled
Tests / PHP 8.4 (push) Has been cancelled

This commit is contained in:
jiangdong.cheng
2026-02-11 17:28:36 +08:00
parent dcb82557c7
commit aa16c9f8c2
162 changed files with 22333 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use App\Models\AiModel;
use App\Models\Article;
use App\Models\Guide;
use App\Models\Tool;
use Illuminate\Contracts\View\View;
class DashboardController extends Controller
{
public function __invoke(): View
{
return view('admin.dashboard', [
'counts' => [
'tools' => Tool::query()->count(),
'models' => AiModel::query()->count(),
'articles' => Article::query()->count(),
'guides' => Guide::query()->count(),
],
'recentTools' => Tool::query()->latest('updated_at')->limit(5)->get(),
'recentModels' => AiModel::query()->latest('updated_at')->limit(5)->get(),
'recentArticles' => Article::query()->latest('updated_at')->limit(5)->get(),
'recentGuides' => Guide::query()->latest('updated_at')->limit(5)->get(),
]);
}
}