diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index ad0318720..7df1ed2b1 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -33,7 +33,6 @@ use Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull; use Pterodactyl\Http\Middleware\Api\Client\SubstituteClientBindings; use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance; use Pterodactyl\Http\Middleware\Api\Application\AuthenticateApplicationUser; -use Pterodactyl\Http\Middleware\Api\Application\SubstituteApplicationApiBindings; class Kernel extends HttpKernel { @@ -71,7 +70,6 @@ class Kernel extends HttpKernel AuthenticateIPAccess::class, ], 'application-api' => [ -// SubstituteApplicationApiBindings::class, SubstituteBindings::class, AuthenticateApplicationUser::class, ], diff --git a/app/Http/Middleware/Api/Application/SubstituteApplicationApiBindings.php b/app/Http/Middleware/Api/Application/SubstituteApplicationApiBindings.php deleted file mode 100644 index e629f6ca6..000000000 --- a/app/Http/Middleware/Api/Application/SubstituteApplicationApiBindings.php +++ /dev/null @@ -1,66 +0,0 @@ - Allocation::class, - 'database' => Database::class, - 'egg' => Egg::class, - 'location' => Location::class, - 'nest' => Nest::class, - 'node' => Node::class, - 'server' => Server::class, - 'user' => User::class, - ]; - - public function __construct(Registrar $router) - { - $this->router = $router; - } - - /** - * Perform substitution of route parameters without triggering - * a 404 error if a model is not found. - * - * @param \Illuminate\Http\Request $request - * - * @return mixed - */ - public function handle($request, Closure $next) - { - foreach (self::$mappings as $key => $class) { - $this->router->bind($key, $class); - } - - try { - $this->router->substituteImplicitBindings($route = $request->route()); - } catch (ModelNotFoundException $exception) { - if (!empty($route) && $route->getMissing()) { - $route->getMissing()($request); - } - - throw $exception; - } - - return $next($request); - } -}