@@ -16,7 +16,7 @@ |
||
16 | 16 | */ |
17 | 17 | public function register() |
18 | 18 | { |
19 | - $this->app->bind(MessageServiceInterface::class, function ($app) { |
|
19 | + $this->app->bind(MessageServiceInterface::class, function($app) { |
|
20 | 20 | return new MessageService( |
21 | 21 | $this->app->make(ContactServiceInterface::class) |
22 | 22 | ); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function thread(string $thread_id): Thread |
64 | 64 | { |
65 | - return Thread::with(['messages', 'participants.user'])->find($thread_id); |
|
65 | + return Thread::with([ 'messages', 'participants.user' ])->find($thread_id); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * @param null|array $recipients |
86 | 86 | * @return Thread |
87 | 87 | */ |
88 | - public function newThread(string $subject, User $user, array $content, ?array $recipients = []): Thread |
|
88 | + public function newThread(string $subject, User $user, array $content, ?array $recipients = [ ]): Thread |
|
89 | 89 | { |
90 | 90 | /** @var $thread Thread */ |
91 | 91 | $thread = Thread::create([ |
@@ -94,11 +94,11 @@ discard block |
||
94 | 94 | |
95 | 95 | // Recipients are participants too |
96 | 96 | collect($recipients) |
97 | - ->map(function ($recipient) { |
|
97 | + ->map(function($recipient) { |
|
98 | 98 | return User::find($recipient); |
99 | 99 | }) |
100 | 100 | ->filter() |
101 | - ->each(function ($recipient) use ($thread) { |
|
101 | + ->each(function($recipient) use ($thread) { |
|
102 | 102 | $this->addParticipant($thread, $recipient); |
103 | 103 | }); |
104 | 104 | |
@@ -181,13 +181,13 @@ discard block |
||
181 | 181 | 'user_id' => $user->id, |
182 | 182 | 'thread_id' => $thread->id, |
183 | 183 | ], |
184 | - $mark_as_read ? ['last_read' => now()] : []); |
|
184 | + $mark_as_read ? [ 'last_read' => now() ] : [ ]); |
|
185 | 185 | |
186 | 186 | $users = $thread->users()->get(); |
187 | 187 | |
188 | - $users->each(function ($user) use ($users){ |
|
189 | - $users->each(function ($contact) use ($user){ |
|
190 | - if(!$user->is($contact)) |
|
188 | + $users->each(function($user) use ($users){ |
|
189 | + $users->each(function($contact) use ($user){ |
|
190 | + if (!$user->is($contact)) |
|
191 | 191 | { |
192 | 192 | $this->contactService->addContact($user, $contact); |
193 | 193 | } |