@@ -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 | } |