created a classifier and draw generator

This commit is contained in:
ghassan committed 2025-07-30 21:38:19 +03:00
1 parent fec7cb655b
commit 3fe9417af4
4 files changed
+333 -1

No files matched your search

+20
View File
@@ -1,6 +1,9 @@
<?php
use Illuminate\Support\Facades\Route;
use app\Helpers\FighterClassification;
use App\Models\Member;
/*
|--------------------------------------------------------------------------
@@ -16,3 +19,20 @@ use Illuminate\Support\Facades\Route;
Route::get('/', function () {
return view('welcome');
});
Route::get('/find', function () {
$fighters = \App\Models\Member::all()->toArray();
// Call global function with leading backslash to avoid namespace issue
$groupedJson = \groupFighters($fighters, 2025);
return response($groupedJson, 200)->header('Content-Type', 'application/json');
});
Route::get('/taekwondo-draw', function () {
$fighters = Member::all()->toArray();
$draws = groupFightersWithTaekwondoDraw($fighters, 2025); // Change year if you want
return response()->json($draws, 200);
});