diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index e7cddeffb..7484a53cf 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -43,7 +43,6 @@ use Illuminate\Http\Resources\Json\JsonResource; use Illuminate\Support\Facades\Gate; use Illuminate\Support\Facades\RateLimiter; -use Illuminate\Support\Facades\Route; use Illuminate\Support\ServiceProvider; use Laravel\Horizon\Horizon; use Laravel\Horizon\MasterSupervisor; @@ -142,7 +141,5 @@ public function bootRoute(): void 'api', static fn (Request $request): Limit => Limit::perMinute(60)->by($request->user()?->id ?: $request->ip()) ); - - Route::bind('gtid', static fn (string $value): User => User::whereGtid($value)->firstOrFail()); } } diff --git a/routes/api.php b/routes/api.php index 3dc62542d..5fcc66c3b 100644 --- a/routes/api.php +++ b/routes/api.php @@ -74,8 +74,11 @@ static function (): void { // Merchandise Route::get('merchandise', [MerchandiseController::class, 'index']); - Route::get('merchandise/{merchandise}/distribute/{gtid}', [MerchandiseController::class, 'getDistribution']); - Route::post('merchandise/{merchandise}/distribute/{gtid}', [MerchandiseController::class, 'distribute']); + Route::get( + 'merchandise/{merchandise}/distribute/{user:gtid}', + [MerchandiseController::class, 'getDistribution'] + ); + Route::post('merchandise/{merchandise}/distribute/{user:gtid}', [MerchandiseController::class, 'distribute']); } );