@@ -79,11 +79,13 @@ discard block |
||
79 | 79 | $users = array_get($baseConfig, 'models.User'); |
80 | 80 | $categories = array_get($config, 'models.BlogCategory'); |
81 | 81 | |
82 | - if (class_exists($model) && method_exists($model, 'setUsersModel')) |
|
83 | - forward_static_call_array([$model, 'setUsersModel'], [$users]); |
|
82 | + if (class_exists($model) && method_exists($model, 'setUsersModel')) { |
|
83 | + forward_static_call_array([$model, 'setUsersModel'], [$users]); |
|
84 | + } |
|
84 | 85 | |
85 | - if (class_exists($model) && method_exists($model, 'setCategoriesModel')) |
|
86 | - forward_static_call_array([$model, 'setCategoriesModel'], [$categories]); |
|
86 | + if (class_exists($model) && method_exists($model, 'setCategoriesModel')) { |
|
87 | + forward_static_call_array([$model, 'setCategoriesModel'], [$categories]); |
|
88 | + } |
|
87 | 89 | |
88 | 90 | return new BlogPostRepository($model); |
89 | 91 | }); |
@@ -102,8 +104,9 @@ discard block |
||
102 | 104 | $model = array_get($config, 'models.BlogCategory'); |
103 | 105 | $posts = array_get($config, 'models.BlogPost'); |
104 | 106 | |
105 | - if (class_exists($model) && method_exists($model, 'setPostsModel')) |
|
106 | - forward_static_call_array([$model, 'setPostsModel'], [$posts]); |
|
107 | + if (class_exists($model) && method_exists($model, 'setPostsModel')) { |
|
108 | + forward_static_call_array([$model, 'setPostsModel'], [$posts]); |
|
109 | + } |
|
107 | 110 | |
108 | 111 | return new BlogCategoryRepository($model); |
109 | 112 | }); |
@@ -20,8 +20,9 @@ |
||
20 | 20 | */ |
21 | 21 | public function __construct($model = null) |
22 | 22 | { |
23 | - if (isset($model)) |
|
24 | - $this->model = $model; |
|
23 | + if (isset($model)) { |
|
24 | + $this->model = $model; |
|
25 | + } |
|
25 | 26 | } |
26 | 27 | |
27 | 28 | /** |
@@ -20,8 +20,9 @@ |
||
20 | 20 | */ |
21 | 21 | public function __construct($model = null) |
22 | 22 | { |
23 | - if (isset($model)) |
|
24 | - $this->model = $model; |
|
23 | + if (isset($model)) { |
|
24 | + $this->model = $model; |
|
25 | + } |
|
25 | 26 | } |
26 | 27 | |
27 | 28 | /** |
@@ -92,9 +92,10 @@ |
||
92 | 92 | |
93 | 93 | public function applySearch($repo, $terms, $fields) |
94 | 94 | { |
95 | - foreach($terms as $term) |
|
96 | - foreach($fields as $field) |
|
97 | - $repo = $repo->orWhere($field, 'LIKE', '%' . $term . '%'); |
|
95 | + foreach($terms as $term) { |
|
96 | + foreach($fields as $field) |
|
97 | + $repo = $repo->orWhere($field, 'LIKE', '%' . $term . '%'); |
|
98 | + } |
|
98 | 99 | |
99 | 100 | foreach($repo as $data) |
100 | 101 | { |