mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 14:34:44 +02:00
This has to match up with the parent
This commit is contained in:
parent
7df31a1eeb
commit
add838d42f
@ -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();
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user