@@ -31,7 +31,7 @@ |
||
| 31 | 31 | ->withTrashed() |
| 32 | 32 | ->findOrNew($id); |
| 33 | 33 | $isNew = $record->id === null; |
| 34 | - $cloneId = (int)$this->request->query->get('from', 0); |
|
| 34 | + $cloneId = (int) $this->request->query->get('from', 0); |
|
| 35 | 35 | |
| 36 | 36 | // init model |
| 37 | 37 | $model = new FormContentUpdate($record, $cloneId); |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | <?php if (\App::$Debug): ?> |
| 31 | 31 | <?= \App::$Debug->renderHead() ?> |
| 32 | 32 | <?php endif; ?> |
| 33 | - <?php if (!isset($fullgrid)){ $fullgrid = false; } ?> |
|
| 33 | + <?php if (!isset($fullgrid)) { $fullgrid = false; } ?> |
|
| 34 | 34 | </head> |
| 35 | 35 | <body class="bg-light"> |
| 36 | 36 | |
@@ -45,23 +45,23 @@ discard block |
||
| 45 | 45 | if (\App::$Properties->get('multiLanguage') && count(\App::$Properties->get('languages')) > 1) { |
| 46 | 46 | foreach (\App::$Properties->get('languages') as $lang) { |
| 47 | 47 | $navbar->menu('left', [ |
| 48 | - 'text' => '<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="flag flag-' . $lang . '" alt="' . $lang . '">', |
|
| 49 | - 'link' => App::$Alias->baseUrlNoLang . '/' . $lang . App::$Request->getPathInfo(), |
|
| 48 | + 'text' => '<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="flag flag-'.$lang.'" alt="'.$lang.'">', |
|
| 49 | + 'link' => App::$Alias->baseUrlNoLang.'/'.$lang.App::$Request->getPathInfo(), |
|
| 50 | 50 | 'html' => true |
| 51 | 51 | ]); |
| 52 | 52 | } |
| 53 | 53 | } |
| 54 | 54 | if (\App::$User->isAuth()) { |
| 55 | 55 | $userId = \App::$User->identity()->getId(); |
| 56 | - $navbar->menu('right', ['text' => __('Account') . ' <span class="badge" id="summary-count-block">0</span>', 'dropdown' => [ |
|
| 56 | + $navbar->menu('right', ['text' => __('Account').' <span class="badge" id="summary-count-block">0</span>', 'dropdown' => [ |
|
| 57 | 57 | ['text' => __('My profile'), 'link' => ['profile/show', [$userId]]], |
| 58 | - ['text' => __('Messages') . ' <span class="badge" id="pm-count-block">0</span>', 'link' => ['profile/messages'], 'class' => 'dropdown-item', 'html' => true], |
|
| 58 | + ['text' => __('Messages').' <span class="badge" id="pm-count-block">0</span>', 'link' => ['profile/messages'], 'class' => 'dropdown-item', 'html' => true], |
|
| 59 | 59 | ['text' => __('Feed'), 'link' => ['profile/feed'], 'class' => 'dropdown-item'], |
| 60 | - ['text' => __('Notifications') . ' <span class="badge" id="notify-count-block">0</span>', 'link' => ['profile/notifications'], 'class' => 'dropdown-item', 'html' => true], |
|
| 60 | + ['text' => __('Notifications').' <span class="badge" id="notify-count-block">0</span>', 'link' => ['profile/notifications'], 'class' => 'dropdown-item', 'html' => true], |
|
| 61 | 61 | ['text' => __('Settings'), 'link' => ['profile/settings'], 'class' => 'dropdown-item'], |
| 62 | 62 | ], 'properties' => ['html' => true]]); |
| 63 | 63 | if (\App::$User->identity()->role->can('Admin/Main/Index')) { |
| 64 | - $navbar->menu('right', ['text' => __('Admin'), 'link' => \App::$Alias->scriptUrl . '/admin']); |
|
| 64 | + $navbar->menu('right', ['text' => __('Admin'), 'link' => \App::$Alias->scriptUrl.'/admin']); |
|
| 65 | 65 | } |
| 66 | 66 | $navbar->menu('right', ['text' => __('Logout'), 'link' => ['user/logout']]); |
| 67 | 67 | } else { |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | <div class="media-left"> |
| 179 | 179 | <a href="<?= ($comment->user ? Url::link(['user/update', [$comment->user->id]]) : '#') ?>"> |
| 180 | 180 | <?php |
| 181 | - $commentAva = \App::$Alias->scriptUrl . '/upload/user/avatar/small/default.jpg'; |
|
| 181 | + $commentAva = \App::$Alias->scriptUrl.'/upload/user/avatar/small/default.jpg'; |
|
| 182 | 182 | if ($comment->user && $comment->user->id > 0) { |
| 183 | 183 | $commentAva = $comment->user->profile->getAvatarUrl('small'); |
| 184 | 184 | } |
@@ -222,8 +222,8 @@ discard block |
||
| 222 | 222 | $list = $this->listing('ul', ['class' => 'list-inline']); |
| 223 | 223 | foreach (\App::$Properties->get('languages') as $lang) { |
| 224 | 224 | $list->li([ |
| 225 | - 'text' => '<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="flag flag-' . $lang . '" alt="' . $lang . '">', |
|
| 226 | - 'link' => App::$Alias->baseUrlNoLang . '/' . $lang . App::$Request->getPathInfo(), |
|
| 225 | + 'text' => '<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="flag flag-'.$lang.'" alt="'.$lang.'">', |
|
| 226 | + 'link' => App::$Alias->baseUrlNoLang.'/'.$lang.App::$Request->getPathInfo(), |
|
| 227 | 227 | 'html' => true |
| 228 | 228 | ], ['class' => 'list-inline-item']); |
| 229 | 229 | } |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | </li> |
| 267 | 267 | <li class="nav-item<?= (\App::$Request->getController() === 'Main' && \App::$Request->getAction() !== 'Index') ? ' active' : null ?>"> |
| 268 | 268 | <?= Url::a(['#system-dropdown'], |
| 269 | - '<i class="fa fa-fire"></i> <span class="nav-text">' . __('System') . '</span>', |
|
| 269 | + '<i class="fa fa-fire"></i> <span class="nav-text">'.__('System').'</span>', |
|
| 270 | 270 | [ |
| 271 | 271 | 'class' => 'nav-container', |
| 272 | 272 | 'data-toggle' => 'collapse', |
@@ -274,12 +274,12 @@ discard block |
||
| 274 | 274 | ]) |
| 275 | 275 | ?> |
| 276 | 276 | |
| 277 | - <?= $this->bootstrap()->nav('ul', ['class' => 'nav nav-pills nav-stacked collapse' . ((\App::$Request->getController() === 'Main' && \App::$Request->getAction() !== 'Index') ? 'in show' : null), 'id' => 'system-dropdown']) |
|
| 278 | - ->menu(['link' => ['main/settings'], 'text' => '<i class="fa fa-cogs"></i> ' . __('Settings'), 'html' => true]) |
|
| 279 | - ->menu(['link' => ['main/files'], 'text' => '<i class="fa fa-file-o"></i> ' . __('Files'), 'html' => true]) |
|
| 280 | - ->menu(['link' => ['main/antivirus'], 'text' => '<i class="fa fa-shield"></i> ' . __('Antivirus'), 'html' => true]) |
|
| 281 | - ->menu(['link' => ['main/routing'], 'text' => '<i class="fa fa-code"></i> ' . __('Routing'), 'html' => true]) |
|
| 282 | - ->menu(['link' => ['main/updates'], 'text' => '<i class="fa fa-gavel"></i> ' . __('Updates'), 'html' => true]) |
|
| 277 | + <?= $this->bootstrap()->nav('ul', ['class' => 'nav nav-pills nav-stacked collapse'.((\App::$Request->getController() === 'Main' && \App::$Request->getAction() !== 'Index') ? 'in show' : null), 'id' => 'system-dropdown']) |
|
| 278 | + ->menu(['link' => ['main/settings'], 'text' => '<i class="fa fa-cogs"></i> '.__('Settings'), 'html' => true]) |
|
| 279 | + ->menu(['link' => ['main/files'], 'text' => '<i class="fa fa-file-o"></i> '.__('Files'), 'html' => true]) |
|
| 280 | + ->menu(['link' => ['main/antivirus'], 'text' => '<i class="fa fa-shield"></i> '.__('Antivirus'), 'html' => true]) |
|
| 281 | + ->menu(['link' => ['main/routing'], 'text' => '<i class="fa fa-code"></i> '.__('Routing'), 'html' => true]) |
|
| 282 | + ->menu(['link' => ['main/updates'], 'text' => '<i class="fa fa-gavel"></i> '.__('Updates'), 'html' => true]) |
|
| 283 | 283 | ->display(); |
| 284 | 284 | ?> |
| 285 | 285 | </li> |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | ?> |
| 298 | 298 | <li class="nav-item<?= (array_key_exists(\App::$Request->getController(), $apps) || \App::$Request->getController() === 'Application') ? ' active' : null ?>"> |
| 299 | 299 | <?= Url::a(['#apps-dropdown'], |
| 300 | - '<i class="fa fa-plug"></i> <span class="nav-text">' . __('Applications') . '</span>', |
|
| 300 | + '<i class="fa fa-plug"></i> <span class="nav-text">'.__('Applications').'</span>', |
|
| 301 | 301 | [ |
| 302 | 302 | 'class' => 'nav-container', |
| 303 | 303 | 'data-toggle' => 'collapse', |
@@ -306,18 +306,18 @@ discard block |
||
| 306 | 306 | ?> |
| 307 | 307 | |
| 308 | 308 | <?php |
| 309 | - $appMenu = $this->bootstrap()->nav('ul', ['class' => 'nav nav-pills nav-stacked collapse' . ((array_key_exists(\App::$Request->getController(), $apps) || \App::$Request->getController() === 'Application') ? 'in show' : null), 'id' => 'apps-dropdown']); |
|
| 309 | + $appMenu = $this->bootstrap()->nav('ul', ['class' => 'nav nav-pills nav-stacked collapse'.((array_key_exists(\App::$Request->getController(), $apps) || \App::$Request->getController() === 'Application') ? 'in show' : null), 'id' => 'apps-dropdown']); |
|
| 310 | 310 | foreach ($apps as $app) { |
| 311 | 311 | /** @var \Apps\ActiveRecord\App $app */ |
| 312 | - $appMenu->menu(['link' => [Str::lowerCase($app->sys_name) . '/index'], 'text' => $app->getLocaleName()]); |
|
| 312 | + $appMenu->menu(['link' => [Str::lowerCase($app->sys_name).'/index'], 'text' => $app->getLocaleName()]); |
|
| 313 | 313 | } |
| 314 | - $appMenu->menu(['link' => 'application/index', 'text' => __('All apps') . '...']); |
|
| 314 | + $appMenu->menu(['link' => 'application/index', 'text' => __('All apps').'...']); |
|
| 315 | 315 | echo $appMenu->display(); |
| 316 | 316 | ?> |
| 317 | 317 | </li> |
| 318 | 318 | <li class="nav-item<?= (array_key_exists(\App::$Request->getController(), $widgets) || \App::$Request->getController() === 'Widget') ? ' active' : null ?>"> |
| 319 | 319 | <?= Url::a(['#widgets-dropdown'], |
| 320 | - '<i class="fa fa-puzzle-piece"></i> <span class="nav-text">' . __('Widgets') . '</span>', |
|
| 320 | + '<i class="fa fa-puzzle-piece"></i> <span class="nav-text">'.__('Widgets').'</span>', |
|
| 321 | 321 | [ |
| 322 | 322 | 'class' => 'nav-container', |
| 323 | 323 | 'data-toggle' => 'collapse', |
@@ -326,12 +326,12 @@ discard block |
||
| 326 | 326 | ?> |
| 327 | 327 | |
| 328 | 328 | <?php |
| 329 | - $widgetMenu = $this->bootstrap()->nav('ul', ['class' => 'nav nav-pills nav-stacked collapse' . ((array_key_exists(\App::$Request->getController(), $widgets) || \App::$Request->getController() === 'Widget') ? 'in show' : null), 'id' => 'widgets-dropdown']); |
|
| 329 | + $widgetMenu = $this->bootstrap()->nav('ul', ['class' => 'nav nav-pills nav-stacked collapse'.((array_key_exists(\App::$Request->getController(), $widgets) || \App::$Request->getController() === 'Widget') ? 'in show' : null), 'id' => 'widgets-dropdown']); |
|
| 330 | 330 | foreach ($widgets as $widget) { |
| 331 | 331 | /** @var \Apps\ActiveRecord\App $widget */ |
| 332 | - $widgetMenu->menu(['link' => [Str::lowerCase($widget->sys_name) . '/index'], 'text' => $widget->getLocaleName()]); |
|
| 332 | + $widgetMenu->menu(['link' => [Str::lowerCase($widget->sys_name).'/index'], 'text' => $widget->getLocaleName()]); |
|
| 333 | 333 | } |
| 334 | - $widgetMenu->menu(['link' => 'widget/index', 'text' => __('All widgets') . '...']); |
|
| 334 | + $widgetMenu->menu(['link' => 'widget/index', 'text' => __('All widgets').'...']); |
|
| 335 | 335 | echo $widgetMenu->display(); |
| 336 | 336 | ?> |
| 337 | 337 | </li> |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | var script_lang = '<?= \App::$Request->getLanguage() ?>'; |
| 28 | 28 | var site_url = '<?= \App::$Alias->baseUrl ?>'; |
| 29 | 29 | </script> |
| 30 | - <?php if (!isset($fullgrid)){ $fullgrid = false; } ?> |
|
| 30 | + <?php if (!isset($fullgrid)) { $fullgrid = false; } ?> |
|
| 31 | 31 | </head> |
| 32 | 32 | |
| 33 | 33 | <body> |
@@ -44,8 +44,8 @@ discard block |
||
| 44 | 44 | $list = $this->listing('ul', ['class' => 'list-inline']); |
| 45 | 45 | foreach (\App::$Properties->get('languages') as $lang) { |
| 46 | 46 | $list->li([ |
| 47 | - 'text' => '<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="flag flag-' . $lang . '" alt="' . $lang . '">', |
|
| 48 | - 'link' => App::$Alias->baseUrlNoLang . '/' . $lang . App::$Request->getPathInfo(), |
|
| 47 | + 'text' => '<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="flag flag-'.$lang.'" alt="'.$lang.'">', |
|
| 48 | + 'link' => App::$Alias->baseUrlNoLang.'/'.$lang.App::$Request->getPathInfo(), |
|
| 49 | 49 | 'html' => true |
| 50 | 50 | ], ['class' => 'list-inline-item']); |
| 51 | 51 | } |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | public function __construct(ContentCategory $record, $dependId = null) |
| 37 | 37 | { |
| 38 | 38 | $this->_record = $record; |
| 39 | - $this->_tmpDependId = (int)$dependId; |
|
| 39 | + $this->_tmpDependId = (int) $dependId; |
|
| 40 | 40 | parent::__construct(); |
| 41 | 41 | } |
| 42 | 42 | |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | ]; |
| 114 | 114 | |
| 115 | 115 | // general category |
| 116 | - if (!$this->_new && (int)$this->_record->id === 1) { |
|
| 116 | + if (!$this->_new && (int) $this->_record->id === 1) { |
|
| 117 | 117 | $rules[] = ['path', 'used']; |
| 118 | 118 | } else { |
| 119 | 119 | $rules[] = ['path', 'required']; |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | $rules[] = ['path', 'reverse_match', '/[\/\'~`\!@#\$%\^&\*\(\)+=\{\}\[\]\|;:"\<\>,\?\\\]/']; |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | - $rules[] = ['title.' . App::$Request->getLanguage(), 'required']; |
|
| 125 | + $rules[] = ['title.'.App::$Request->getLanguage(), 'required']; |
|
| 126 | 126 | |
| 127 | 127 | |
| 128 | 128 | return $rules; |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | { |
| 136 | 136 | $this->_record->title = $this->title; |
| 137 | 137 | $this->_record->description = $this->description; |
| 138 | - $savePath = trim($this->_pathNested . '/' . $this->path, '/'); |
|
| 138 | + $savePath = trim($this->_pathNested.'/'.$this->path, '/'); |
|
| 139 | 139 | $this->_record->path = $savePath; |
| 140 | 140 | $this->_record->configs = $this->configs; |
| 141 | 141 | $this->_record->save(); |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | // build path with owner category |
| 171 | 171 | $this->_pathNested = $owner->path; |
| 172 | 172 | if (Str::length($this->_pathNested) > 0) { |
| 173 | - $path = $this->_pathNested . '/' . $path; |
|
| 173 | + $path = $this->_pathNested.'/'.$path; |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | // make select for check |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | ]); |
| 56 | 56 | |
| 57 | 57 | foreach ($records as $user) { |
| 58 | - $roleHtml = $user->role->color ? '<span class="badge badge-light" style="color: ' . $user->role->color . '">' . $user->role->name . '</span>' : $user->role->name; |
|
| 58 | + $roleHtml = $user->role->color ? '<span class="badge badge-light" style="color: '.$user->role->color.'">'.$user->role->name.'</span>' : $user->role->name; |
|
| 59 | 59 | |
| 60 | 60 | $btngrp = $this->bootstrap()->btngroup(['class' => 'btn-group btn-group-sm'], 4) |
| 61 | 61 | ->add('<i class="fa fa-pencil"></i>', ['user/update', [$user->id]], ['class' => 'btn btn-primary', 'html' => true]) |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | ['text' => Date::convertToDatetime($user->created_at, Date::FORMAT_TO_DAY)], |
| 76 | 76 | ['text' => $btngrp->display(), |
| 77 | 77 | 'properties' => ['class' => 'text-center'], 'html' => true], |
| 78 | - 'properties' => ['class' => 'checkbox-row' . ($user->approve_token !== null ? ' bg-warning' : null)] |
|
| 78 | + 'properties' => ['class' => 'checkbox-row'.($user->approve_token !== null ? ' bg-warning' : null)] |
|
| 79 | 79 | |
| 80 | 80 | ]); |
| 81 | 81 | } |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | $records = CommentAnswer::with(['user', 'user.profile', 'user.role']) |
| 43 | 43 | ->where('comment_id', $commentId) |
| 44 | 44 | ->where('moderate', false); |
| 45 | - if ((bool)$configs['onlyLocale']) { |
|
| 45 | + if ((bool) $configs['onlyLocale']) { |
|
| 46 | 46 | $records = $records->where('lang', $this->request->getLanguage()); |
| 47 | 47 | } |
| 48 | 48 | |
@@ -32,9 +32,9 @@ discard block |
||
| 32 | 32 | // get configs |
| 33 | 33 | $configs = AppRecord::getConfigs('widget', 'Comments'); |
| 34 | 34 | // items per page |
| 35 | - $perPage = (int)$configs['perPage']; |
|
| 35 | + $perPage = (int) $configs['perPage']; |
|
| 36 | 36 | // offset can be only integer |
| 37 | - $index = (int)$this->request->query->get('offset', 0); |
|
| 37 | + $index = (int) $this->request->query->get('offset', 0); |
|
| 38 | 38 | $offset = $perPage * $index; |
| 39 | 39 | |
| 40 | 40 | // select comments from db and check it |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | ->where('moderate', false); |
| 44 | 44 | |
| 45 | 45 | // check if comments is depend of language locale |
| 46 | - if ((bool)$configs['onlyLocale']) { |
|
| 46 | + if ((bool) $configs['onlyLocale']) { |
|
| 47 | 47 | $query = $query->where('lang', $this->request->getLanguage()); |
| 48 | 48 | } |
| 49 | 49 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | // build output json data as array |
| 65 | 65 | $data = []; |
| 66 | - $records->each(function ($comment) use (&$data){ |
|
| 66 | + $records->each(function($comment) use (&$data){ |
|
| 67 | 67 | $data[] = (new EntityCommentData($comment))->make(); |
| 68 | 68 | }); |
| 69 | 69 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | // get special types for this action |
| 45 | 45 | $queryType = $this->request->get('type'); |
| 46 | - $queryId = (int)$this->request->get('id'); |
|
| 46 | + $queryId = (int) $this->request->get('id'); |
|
| 47 | 47 | // get current user object |
| 48 | 48 | $user = App::$User->identity(); |
| 49 | 49 | |
@@ -59,11 +59,11 @@ discard block |
||
| 59 | 59 | switch ($queryType) { |
| 60 | 60 | case 'after': |
| 61 | 61 | $messages = Message::where('id', '>', $queryId) |
| 62 | - ->where(function ($query) use ($corId, $user) { |
|
| 63 | - $query->where(function ($q) use ($corId, $user) { |
|
| 62 | + ->where(function($query) use ($corId, $user) { |
|
| 63 | + $query->where(function($q) use ($corId, $user) { |
|
| 64 | 64 | $q->where('target_id', '=', $user->getId()) |
| 65 | 65 | ->where('sender_id', '=', $corId); |
| 66 | - })->orWhere(function ($q) use ($corId, $user) { |
|
| 66 | + })->orWhere(function($q) use ($corId, $user) { |
|
| 67 | 67 | $q->where('target_id', '=', $corId) |
| 68 | 68 | ->where('sender_id', '=', $user->getId()); |
| 69 | 69 | }); |
@@ -71,21 +71,21 @@ discard block |
||
| 71 | 71 | break; |
| 72 | 72 | case 'before': |
| 73 | 73 | $messages = Message::where('id', '<', $queryId) |
| 74 | - ->where(function ($query) use ($corId, $user) { |
|
| 75 | - $query->where(function ($q) use ($corId, $user) { |
|
| 74 | + ->where(function($query) use ($corId, $user) { |
|
| 75 | + $query->where(function($q) use ($corId, $user) { |
|
| 76 | 76 | $q->where('target_id', '=', $user->getId()) |
| 77 | 77 | ->where('sender_id', '=', $corId); |
| 78 | - })->orWhere(function ($q) use ($corId, $user) { |
|
| 78 | + })->orWhere(function($q) use ($corId, $user) { |
|
| 79 | 79 | $q->where('target_id', '=', $corId) |
| 80 | 80 | ->where('sender_id', '=', $user->getId()); |
| 81 | 81 | }); |
| 82 | 82 | }); |
| 83 | 83 | break; |
| 84 | 84 | default: |
| 85 | - $messages = Message::where(function ($query) use ($corId, $user) { |
|
| 85 | + $messages = Message::where(function($query) use ($corId, $user) { |
|
| 86 | 86 | $query->where('target_id', '=', $user->getId()) |
| 87 | 87 | ->where('sender_id', '=', $corId); |
| 88 | - })->orWhere(function ($query) use ($corId, $user) { |
|
| 88 | + })->orWhere(function($query) use ($corId, $user) { |
|
| 89 | 89 | $query->where('target_id', '=', $corId) |
| 90 | 90 | ->where('sender_id', '=', $user->getId()); |
| 91 | 91 | }); |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | |
| 106 | 106 | // build response |
| 107 | 107 | $response = []; |
| 108 | - $messages->get()->each(function ($msg) use (&$response, $user){ |
|
| 108 | + $messages->get()->each(function($msg) use (&$response, $user){ |
|
| 109 | 109 | /** @var Message $msg */ |
| 110 | 110 | $response[] = [ |
| 111 | 111 | 'id' => $msg->id, |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | ]; |
| 117 | 117 | |
| 118 | 118 | // update status to readed |
| 119 | - if (!(bool)$msg->readed && $msg->sender_id !== $user->id) { |
|
| 119 | + if (!(bool) $msg->readed && $msg->sender_id !== $user->id) { |
|
| 120 | 120 | $msg->readed = true; |
| 121 | 121 | $msg->save(); |
| 122 | 122 | } |