@@ -107,8 +107,9 @@ discard block |
||
107 | 107 | $model = $this->app->make($this->model()); |
108 | 108 | //$model = app()->make($this->model()); |
109 | 109 | |
110 | - if (!$model instanceof Model) |
|
111 | - throw new RepositoryException("Class {$this->model()} must be an instance of Illuminate\\Database\\Eloquent\\Model"); |
|
110 | + if (!$model instanceof Model) { |
|
111 | + throw new RepositoryException("Class {$this->model()} must be an instance of Illuminate\\Database\\Eloquent\\Model"); |
|
112 | + } |
|
112 | 113 | |
113 | 114 | return $this->model = $model; |
114 | 115 | } |
@@ -143,12 +144,14 @@ discard block |
||
143 | 144 | } |
144 | 145 | |
145 | 146 | public function applyCriteria() { |
146 | - if($this->skipCriteria === true) |
|
147 | - return $this; |
|
147 | + if($this->skipCriteria === true) { |
|
148 | + return $this; |
|
149 | + } |
|
148 | 150 | |
149 | 151 | foreach($this->getCriteria() as $criteria) { |
150 | - if($criteria instanceof Criteria) |
|
151 | - $this->model = $criteria->apply($this->model, $this); |
|
152 | + if($criteria instanceof Criteria) { |
|
153 | + $this->model = $criteria->apply($this->model, $this); |
|
154 | + } |
|
152 | 155 | } |
153 | 156 | |
154 | 157 | return $this; |
@@ -2,7 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace Afrittella\BackProject\Http\Controllers; |
4 | 4 | |
5 | -use Afrittella\BackProject\Exceptions\NotFoundException; |
|
6 | 5 | use Afrittella\BackProject\Http\Requests\AttachmentAdd; |
7 | 6 | use Afrittella\BackProject\Repositories\Attachments; |
8 | 7 | use Afrittella\BackProject\Repositories\Criteria\Attachments\ByUser; |
@@ -10,7 +10,6 @@ |
||
10 | 10 | use Afrittella\BackProject\Services\BackProject; |
11 | 11 | use Afrittella\BackProject\Services\SlugGenerator; |
12 | 12 | use Illuminate\Support\ServiceProvider; |
13 | -use Illuminate\Routing\Router; |
|
14 | 13 | use function Symfony\Component\HttpKernel\Tests\controller_func; |
15 | 14 | |
16 | 15 |