From 4b5ee920bd986e642a4fc6bd2de276a8eb169c09 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sat, 6 Jan 2018 13:08:20 -0600 Subject: [PATCH] Fix logic mistake with findOrFail --- app/Repositories/Eloquent/EggRepository.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Repositories/Eloquent/EggRepository.php b/app/Repositories/Eloquent/EggRepository.php index bfb6738d9..10d27f284 100644 --- a/app/Repositories/Eloquent/EggRepository.php +++ b/app/Repositories/Eloquent/EggRepository.php @@ -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; }