Fix parameter bindings for client API routes; closes pterodactyl/panel#2359

This commit is contained in:
Dane Everitt 2020-09-27 10:39:18 -07:00
parent 1db7e4db66
commit f31a6d3967
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
3 changed files with 62 additions and 3 deletions

View file

@ -49,11 +49,11 @@ class SubstituteClientApiBindings extends ApiSubstituteBindings
return Database::query()->where('id', $id)->firstOrFail();
});
$this->router->model('backup', Backup::class, function ($value) {
$this->router->bind('backup', function ($value) {
return Backup::query()->where('uuid', $value)->firstOrFail();
});
$this->router->model('user', User::class, function ($value) {
$this->router->bind('user', function ($value) {
return User::query()->where('uuid', $value)->firstOrFail();
});