1
1
mirror of https://github.com/pterodactyl/panel.git synced 2024-10-27 20:32:28 +01:00

Fix logic mistake with findOrFail

This commit is contained in:
Dane Everitt 2018-01-06 13:08:20 -06:00
parent adcab5969a
commit 4b5ee920bd
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53

View File

@ -32,7 +32,7 @@ class EggRepository extends EloquentRepository implements EggRepositoryInterface
public function getWithVariables(int $id): Egg
{
try {
return $this->getBuilder()->with('variables')->firstOrFail($id, $this->getColumns());
return $this->getBuilder()->with('variables')->findOrFail($id, $this->getColumns());
} catch (ModelNotFoundException $exception) {
throw new RecordNotFoundException;
}
@ -79,7 +79,7 @@ class EggRepository extends EloquentRepository implements EggRepositoryInterface
public function getWithExportAttributes(int $id): Egg
{
try {
return $this->getBuilder()->with('scriptFrom', 'configFrom', 'variables')->find($id, $this->getColumns());
return $this->getBuilder()->with('scriptFrom', 'configFrom', 'variables')->findOrFail($id, $this->getColumns());
} catch (ModelNotFoundException $exception) {
throw new RecordNotFoundException;
}