@@ -78,10 +78,11 @@ |
||
| 78 | 78 | */ |
| 79 | 79 | public function getCreatedByAttribute($value) |
| 80 | 80 | { |
| 81 | - if ($value > 0) |
|
| 82 | - if ($user = Sentinel::findUserById($value)) |
|
| 81 | + if ($value > 0) { |
|
| 82 | + if ($user = Sentinel::findUserById($value)) |
|
| 83 | 83 | if ($user != null) |
| 84 | 84 | return $user; |
| 85 | + } |
|
| 85 | 86 | |
| 86 | 87 | return $value; |
| 87 | 88 | } |
@@ -58,8 +58,9 @@ discard block |
||
| 58 | 58 | ], 'routes'); |
| 59 | 59 | |
| 60 | 60 | // Include the routes file |
| 61 | - if(file_exists(base_path("app/Http/comments_routes.php"))) |
|
| 62 | - include base_path("app/Http/comments_routes.php"); |
|
| 61 | + if(file_exists(base_path("app/Http/comments_routes.php"))) { |
|
| 62 | + include base_path("app/Http/comments_routes.php"); |
|
| 63 | + } |
|
| 63 | 64 | } |
| 64 | 65 | |
| 65 | 66 | /** |
@@ -76,8 +77,9 @@ discard block |
||
| 76 | 77 | $model = array_get($config, 'models.comment'); |
| 77 | 78 | $users = array_get($baseConfig, 'models.User'); |
| 78 | 79 | |
| 79 | - if (class_exists($model) && method_exists($model, 'setUsersModel')) |
|
| 80 | - forward_static_call_array([$model, 'setUsersModel'], [$users]); |
|
| 80 | + if (class_exists($model) && method_exists($model, 'setUsersModel')) { |
|
| 81 | + forward_static_call_array([$model, 'setUsersModel'], [$users]); |
|
| 82 | + } |
|
| 81 | 83 | |
| 82 | 84 | return new CommentRepository($model); |
| 83 | 85 | }); |
@@ -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 | /** |