Skip to content

Commit 4b5ee92

Browse files
committed
Fix logic mistake with findOrFail
1 parent adcab59 commit 4b5ee92

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/Repositories/Eloquent/EggRepository.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function model()
3232
public function getWithVariables(int $id): Egg
3333
{
3434
try {
35-
return $this->getBuilder()->with('variables')->firstOrFail($id, $this->getColumns());
35+
return $this->getBuilder()->with('variables')->findOrFail($id, $this->getColumns());
3636
} catch (ModelNotFoundException $exception) {
3737
throw new RecordNotFoundException;
3838
}
@@ -79,7 +79,7 @@ public function getWithCopyAttributes($value, string $column = 'id'): Egg
7979
public function getWithExportAttributes(int $id): Egg
8080
{
8181
try {
82-
return $this->getBuilder()->with('scriptFrom', 'configFrom', 'variables')->find($id, $this->getColumns());
82+
return $this->getBuilder()->with('scriptFrom', 'configFrom', 'variables')->findOrFail($id, $this->getColumns());
8383
} catch (ModelNotFoundException $exception) {
8484
throw new RecordNotFoundException;
8585
}

0 commit comments

Comments
 (0)