feat: hunts with participants

This commit is contained in:
Leon 2025-12-19 14:35:28 +01:00
parent aa92b2e838
commit 0306d47fa8
1 changed files with 2 additions and 2 deletions

View File

@ -13,7 +13,7 @@ class HuntsController extends Controller
public function index()
{
try {
$hunts = Hunts::paginate(10);
$hunts = Hunts::with('participants')->paginate(10);
return response()->json($hunts);
} catch (\Exception $e) {
\Illuminate\Support\Facades\Log::error('Error fetching hunts: ' . $e->getMessage());
@ -47,7 +47,7 @@ class HuntsController extends Controller
*/
public function show(Request $request, $id)
{
$hunt = Hunts::with('steps')->find($id);
$hunt = Hunts::with(['steps', 'participants'])->find($id);
if (!$hunt) {
return response()->json(['message' => 'Hunt not found'], 404);