Club System

This commit is contained in:
2026-06-02 20:54:10 +02:00
parent c68c4d18b5
commit 0b18d289ef
38 changed files with 1464 additions and 118 deletions

View File

@@ -0,0 +1,49 @@
<?php
namespace App\Http\Controllers;
use App\Helpers\XenForoHelpers;
use App\Models\Entry;
use App\Services\XenforoService;
use Illuminate\Http\Request;
class QueueController extends Controller
{
public function index()
{
$entries = Entry::inQueue()
->with(['authors', 'game.platform'])
->orderByRaw("CASE WHEN state = 'pending' THEN 1 ELSE 0 END")
->orderBy('created_at', 'asc')
->get();
return view('queue.index', compact('entries'));
}
public function updateComment(Request $request, Entry $entry)
{
$request->validate(['comment' => 'nullable|string|max:2000']);
$entry->update(['staff_comment' => $request->input('comment')]);
return back()->with('success', 'Comment updated');
}
public function approve(Request $request, Entry $entry)
{
// $entry->update(['state' => 'published']);
XenForoHelpers::entryApproved($entry);
return back()->with('success', 'Entry approved');
}
public function reject(Request $request, Entry $entry)
{
$request->validate(['reason' => 'nullable|string|max:2000']);
$entry->update(['state' => 'rejected', 'staff_comment' => $request->input('reason'), 'rejected_at' => now() ]);
return back()->with('success', 'Entry rejected');
}
}