@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | { |
11 | 11 | parent::__construct($resource); |
12 | 12 | |
13 | - TagResource::urlResolver(fn ($name) => route('microblog.tag', [urlencode($name)])); |
|
13 | + TagResource::urlResolver(fn($name) => route('microblog.tag', [urlencode($name)])); |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | public function toArray($request) |
@@ -22,13 +22,13 @@ discard block |
||
22 | 22 | |
23 | 23 | return array_merge_recursive($result, [ |
24 | 24 | 'assets' => $assets, |
25 | - 'tags' => $this->whenLoaded('tags', fn () => TagResource::collection($this->resource->tags)), |
|
25 | + 'tags' => $this->whenLoaded('tags', fn() => TagResource::collection($this->resource->tags)), |
|
26 | 26 | 'is_sponsored' => $this->resource->is_sponsored, |
27 | 27 | 'metadata' => encrypt([Microblog::class => $this->resource->id]), |
28 | 28 | 'deleted_at' => $this->resource->deleted_at, |
29 | 29 | |
30 | 30 | 'permissions' => [ |
31 | - 'moderate' => $this->when($request->user(), fn () => $request->user()->can('moderate', $this->resource), false) |
|
31 | + 'moderate' => $this->when($request->user(), fn() => $request->user()->can('moderate', $this->resource), false) |
|
32 | 32 | ] |
33 | 33 | ]); |
34 | 34 | } |
@@ -27,7 +27,7 @@ |
||
27 | 27 | $codes = $country->pluck('code', 'id'); |
28 | 28 | |
29 | 29 | $price = $this->input('price'); |
30 | - $priceRule = Rule::requiredIf(fn () => $price > 0); |
|
30 | + $priceRule = Rule::requiredIf(fn() => $price > 0); |
|
31 | 31 | |
32 | 32 | return [ |
33 | 33 | 'payment_method' => 'required|in:card,p24', |
@@ -87,10 +87,10 @@ discard block |
||
87 | 87 | }); |
88 | 88 | |
89 | 89 | // we use model instead of repository to avoid putting global criteria to all methods in repository |
90 | - $this->router->bind('user_trashed', fn ($id) => User::withTrashed()->findOrFail($id)); |
|
90 | + $this->router->bind('user_trashed', fn($id) => User::withTrashed()->findOrFail($id)); |
|
91 | 91 | |
92 | 92 | // we use model instead of repository to avoid putting global criteria to all methods in repository |
93 | - $this->router->bind('topic_trashed', fn ($id) => Topic::withTrashed()->findOrFail($id)); |
|
93 | + $this->router->bind('topic_trashed', fn($id) => Topic::withTrashed()->findOrFail($id)); |
|
94 | 94 | |
95 | 95 | $this->router->bind('topic', function ($id) { |
96 | 96 | $user = $this->getCurrentRequest()->user(); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | return Topic::findOrFail($id); |
103 | 103 | }); |
104 | 104 | |
105 | - $this->router->bind('any_microblog', fn ($id) => Microblog::withoutGlobalScopes()->findOrFail($id)); |
|
105 | + $this->router->bind('any_microblog', fn($id) => Microblog::withoutGlobalScopes()->findOrFail($id)); |
|
106 | 106 | |
107 | 107 | parent::boot(); |
108 | 108 | } |
@@ -29,7 +29,7 @@ |
||
29 | 29 | |
30 | 30 | $parser = app('parser.wiki'); |
31 | 31 | $wiki->load(['comments' => function ($query) { |
32 | - return $query->orderByDesc('updated_at')->with(['user' => fn ($query) => $query->withTrashed()]); |
|
32 | + return $query->orderByDesc('updated_at')->with(['user' => fn($query) => $query->withTrashed()]); |
|
33 | 33 | }]); |
34 | 34 | |
35 | 35 | foreach ($wiki->comments as &$comment) { |
@@ -38,7 +38,7 @@ |
||
38 | 38 | */ |
39 | 39 | public function broadcastOn() |
40 | 40 | { |
41 | - return new Channel('topic:' . $this->comment->post?->topic_id); |
|
41 | + return new Channel('topic:' . $this->comment->post ? ->topic_id); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -98,7 +98,7 @@ |
||
98 | 98 | |
99 | 99 | public function voters(Microblog $microblog) |
100 | 100 | { |
101 | - $microblog->load(['voters', 'voters.user' => fn ($query) => $query->select('id', 'name')->withTrashed()]); |
|
101 | + $microblog->load(['voters', 'voters.user' => fn($query) => $query->select('id', 'name')->withTrashed()]); |
|
102 | 102 | |
103 | 103 | return ['id' => $microblog->id, 'parent_id' => $microblog->parent_id, 'users' => $microblog->voters->pluck('user.name')]; |
104 | 104 | } |
@@ -87,7 +87,7 @@ |
||
87 | 87 | |
88 | 88 | public function voters(Post $post) |
89 | 89 | { |
90 | - $post->load(['votes', 'user' => fn ($query) => $query->select('id', 'name')->withTrashed()]); |
|
90 | + $post->load(['votes', 'user' => fn($query) => $query->select('id', 'name')->withTrashed()]); |
|
91 | 91 | |
92 | 92 | return [ |
93 | 93 | 'id' => $post->id, |
@@ -34,7 +34,7 @@ |
||
34 | 34 | |
35 | 35 | public function parse(string $text): string |
36 | 36 | { |
37 | - return $this->urlPattern->replace($text)->callback(fn (Detail $match) => $this->processLink($match->text())); |
|
37 | + return $this->urlPattern->replace($text)->callback(fn(Detail $match) => $this->processLink($match->text())); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | private function processLink(string $url): string |