Skip to content

Commit 8e4dd72

Browse files
committed
Code cleanup
1 parent 1eda6b0 commit 8e4dd72

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Repositories/AbstractRepository.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -593,11 +593,11 @@ public function delete($entity)
593593
*/
594594
public function makeModel()
595595
{
596-
if (!$this->model) {
597-
throw new RepositoryException("The model class must be set on the repository.");
596+
if (empty($this->model)) {
597+
throw new RepositoryException('The model class must be set on the repository.');
598598
}
599599

600-
return $this->modelInstance = with(new $this->model);
600+
return $this->modelInstance = new $this->model;
601601
}
602602

603603
/**
@@ -693,7 +693,6 @@ public function getErrors()
693693
public function getErrorMessage($default = '')
694694
{
695695
return $this->getErrors()->first('message') ?: $default;
696-
697696
}
698697

699698
/**

0 commit comments

Comments
 (0)