@@ -50,10 +50,10 @@ discard block |
||
50 | 50 | $values = $request->validated(); |
51 | 51 | $user = $request->user(); |
52 | 52 | $thread = $this->service->newThread( |
53 | - $values['subject'], |
|
53 | + $values[ 'subject' ], |
|
54 | 54 | $user, |
55 | - $values['content'], |
|
56 | - Arr::get($values, 'recipients', []) |
|
55 | + $values[ 'content' ], |
|
56 | + Arr::get($values, 'recipients', [ ]) |
|
57 | 57 | ); |
58 | 58 | |
59 | 59 | return new ThreadResource($thread); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $message = $this->service->newMessage( |
86 | 86 | $thread, |
87 | 87 | $user, |
88 | - $values['body'], |
|
88 | + $values[ 'body' ], |
|
89 | 89 | ); |
90 | 90 | |
91 | 91 | return new MessageResource($message); |
@@ -19,6 +19,6 @@ |
||
19 | 19 | { |
20 | 20 | $threads = $this->service->threads(Auth::user()); |
21 | 21 | |
22 | - return view('livewire.message.index', ['threads' => $threads]); |
|
22 | + return view('livewire.message.index', [ 'threads' => $threads ]); |
|
23 | 23 | } |
24 | 24 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function thread(string $thread_id): Thread |
65 | 65 | { |
66 | - return Thread::with(['messages', 'participants.user'])->find($thread_id); |
|
66 | + return Thread::with([ 'messages', 'participants.user' ])->find($thread_id); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * @param null|array $recipients |
87 | 87 | * @return Thread |
88 | 88 | */ |
89 | - public function newThread(string $subject, User $user, array $content, ?array $recipients = []): Thread |
|
89 | + public function newThread(string $subject, User $user, array $content, ?array $recipients = [ ]): Thread |
|
90 | 90 | { |
91 | 91 | /** @var $thread Thread */ |
92 | 92 | $thread = Thread::create([ |
@@ -97,16 +97,16 @@ discard block |
||
97 | 97 | |
98 | 98 | // Recipients are participants too |
99 | 99 | $recipients = collect($recipients) |
100 | - ->map(function ($recipient) { |
|
100 | + ->map(function($recipient) { |
|
101 | 101 | return User::find($recipient); |
102 | 102 | }) |
103 | 103 | ->add($user) |
104 | 104 | ->unique('id') |
105 | - ->map(function ($recipient) use ($thread) { |
|
105 | + ->map(function($recipient) use ($thread) { |
|
106 | 106 | return $this->addParticipant($thread, $recipient); |
107 | 107 | }); |
108 | 108 | |
109 | - $thread->setRelation('messages', collect([$message])); |
|
109 | + $thread->setRelation('messages', collect([ $message ])); |
|
110 | 110 | $thread->setRelation('participants', $recipients); |
111 | 111 | $users = User::find($recipients->pluck('user_id')); |
112 | 112 | Notification::send($users, new ThreadCreated($thread)); |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | 'user_id' => $user->id, |
185 | 185 | 'thread_id' => $thread->id, |
186 | 186 | ], |
187 | - $mark_as_read ? ['last_read' => now()] : []); |
|
187 | + $mark_as_read ? [ 'last_read' => now() ] : [ ]); |
|
188 | 188 | |
189 | 189 | $users = $thread->users()->get(); |
190 | 190 |
@@ -38,6 +38,6 @@ |
||
38 | 38 | |
39 | 39 | public function render() |
40 | 40 | { |
41 | - return view('livewire.contact.delete-contact-form', ['contact' => $this->contact]); |
|
41 | + return view('livewire.contact.delete-contact-form', [ 'contact' => $this->contact ]); |
|
42 | 42 | } |
43 | 43 | } |
@@ -16,6 +16,6 @@ |
||
16 | 16 | |
17 | 17 | public function render() |
18 | 18 | { |
19 | - return view('livewire.contact.card', ['contact' => $this->contact]); |
|
19 | + return view('livewire.contact.card', [ 'contact' => $this->contact ]); |
|
20 | 20 | } |
21 | 21 | } |