From add838d42f5afa8c58d8be4ba0e99f144ae6eef9 Mon Sep 17 00:00:00 2001 From: Lance Pioch Date: Wed, 20 Mar 2024 02:19:20 -0400 Subject: [PATCH] This has to match up with the parent --- .../Middleware/Api/Client/SubstituteClientBindings.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/Http/Middleware/Api/Client/SubstituteClientBindings.php b/app/Http/Middleware/Api/Client/SubstituteClientBindings.php index ea9099260..34e41d89b 100644 --- a/app/Http/Middleware/Api/Client/SubstituteClientBindings.php +++ b/app/Http/Middleware/Api/Client/SubstituteClientBindings.php @@ -2,8 +2,8 @@ namespace App\Http\Middleware\Api\Client; -use Illuminate\Http\Request; use App\Models\Server; +use Closure; use Illuminate\Contracts\Routing\Registrar; use Illuminate\Routing\Middleware\SubstituteBindings; @@ -14,10 +14,9 @@ class SubstituteClientBindings extends SubstituteBindings parent::__construct($router); } - public function handle(Request $request, \Closure $next): mixed + public function handle($request, Closure $next): mixed { - // Override default behavior of the model binding to use a specific table - // column rather than the default 'id'. + // Override default behavior of the model binding to use a specific table column rather than the default 'id'. $this->router->bind('server', function ($value) { return $this->server->query()->where(strlen($value) === 8 ? 'uuidShort' : 'uuid', $value)->firstOrFail(); });