@@ -55,7 +55,7 @@ |
||
55 | 55 | * @param array $recipients |
56 | 56 | * @return Thread |
57 | 57 | */ |
58 | - public function newThread(string $subject, User $user, array $content, array $recipients = []): Thread; |
|
58 | + public function newThread(string $subject, User $user, array $content, array $recipients = [ ]): Thread; |
|
59 | 59 | |
60 | 60 | /** |
61 | 61 | * New message. |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | */ |
66 | 66 | public function thread(string $thread_id): Thread |
67 | 67 | { |
68 | - return Thread::with(['messages', 'participants.user'])->find($thread_id); |
|
68 | + return Thread::with([ 'messages', 'participants.user' ])->find($thread_id); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | * @param null|array $recipients |
100 | 100 | * @return Thread |
101 | 101 | */ |
102 | - public function newThread(string $subject, User $user, array $content, ?array $recipients = []): Thread |
|
102 | + public function newThread(string $subject, User $user, array $content, ?array $recipients = [ ]): Thread |
|
103 | 103 | { |
104 | 104 | /** @var $thread Thread */ |
105 | 105 | $thread = Thread::create([ |
@@ -110,16 +110,16 @@ discard block |
||
110 | 110 | |
111 | 111 | // Recipients are participants too |
112 | 112 | $recipients = collect($recipients) |
113 | - ->map(function ($recipient) { |
|
113 | + ->map(function($recipient) { |
|
114 | 114 | return User::find($recipient); |
115 | 115 | }) |
116 | 116 | ->add($user) |
117 | 117 | ->unique('id') |
118 | - ->map(function ($recipient) use ($thread) { |
|
118 | + ->map(function($recipient) use ($thread) { |
|
119 | 119 | return $this->addParticipant($thread, $recipient); |
120 | 120 | }); |
121 | 121 | |
122 | - $thread->setRelation('messages', collect([$message])); |
|
122 | + $thread->setRelation('messages', collect([ $message ])); |
|
123 | 123 | $thread->setRelation('participants', $recipients); |
124 | 124 | $users = User::find($recipients->pluck('user_id')); |
125 | 125 | Notification::send($users, new ThreadCreated($thread)); |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | 'user_id' => $user->id, |
194 | 194 | 'thread_id' => $thread->id, |
195 | 195 | ], |
196 | - $mark_as_read ? ['last_read' => now()] : []); |
|
196 | + $mark_as_read ? [ 'last_read' => now() ] : [ ]); |
|
197 | 197 | |
198 | 198 | $users = $thread->users()->get(); |
199 | 199 |