Fix logic mistake with findOrFail
This commit is contained in:
parent
adcab5969a
commit
4b5ee920bd
|
@ -32,7 +32,7 @@ class EggRepository extends EloquentRepository implements EggRepositoryInterface
|
||||||
public function getWithVariables(int $id): Egg
|
public function getWithVariables(int $id): Egg
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
return $this->getBuilder()->with('variables')->firstOrFail($id, $this->getColumns());
|
return $this->getBuilder()->with('variables')->findOrFail($id, $this->getColumns());
|
||||||
} catch (ModelNotFoundException $exception) {
|
} catch (ModelNotFoundException $exception) {
|
||||||
throw new RecordNotFoundException;
|
throw new RecordNotFoundException;
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ class EggRepository extends EloquentRepository implements EggRepositoryInterface
|
||||||
public function getWithExportAttributes(int $id): Egg
|
public function getWithExportAttributes(int $id): Egg
|
||||||
{
|
{
|
||||||
try {
|
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) {
|
} catch (ModelNotFoundException $exception) {
|
||||||
throw new RecordNotFoundException;
|
throw new RecordNotFoundException;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue