Fix logic mistake with findOrFail
This commit is contained in:
parent
adcab5969a
commit
4b5ee920bd
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue