mirror of
https://github.com/ProxyPanel/ProxyPanel.git
synced 2026-04-05 12:08:58 +00:00
- Optimize Blade JavaScript code. - Refactored multiple admin controllers for improved validation, error handling, and query efficiency. - Added ProxyConfig trait to centralize proxy configuration options. - Updated NodeStatusDetection to use model relationships for heartbeat checks. - Improved category, label, and country management logic and error logging. - Added new Blade components for admin UI and updated language files and assets for better localization and frontend support. - Bug fixed & introduced more bug :)
31 lines
954 B
PHP
31 lines
954 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\User;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Models\Article;
|
|
use App\Services\ArticleService;
|
|
use App\Services\NodeService;
|
|
use Illuminate\Contracts\View\View;
|
|
use Illuminate\Http\JsonResponse;
|
|
|
|
class ArticleController extends Controller
|
|
{
|
|
public function index(NodeService $nodeService): View
|
|
{ // 帮助中心
|
|
$user = auth()->user();
|
|
|
|
return view('user.knowledge', [
|
|
'subType' => $nodeService->getActiveNodeTypes(),
|
|
'subUrl' => $user->sub_url,
|
|
'subscribe' => $user->subscribe->only(['status', 'ban_desc']),
|
|
'knowledge' => Article::type(1)->lang()->orderByDesc('sort')->latest()->get()->groupBy('category'),
|
|
]);
|
|
}
|
|
|
|
public function show(Article $article): JsonResponse
|
|
{ // 文章详情
|
|
return response()->json(['title' => $article->title, 'content' => (new ArticleService($article))->getContent()]);
|
|
}
|
|
}
|