Skip to content

Commit a4dd3c8

Browse files
driesvintsgithub-actions[bot]
authored andcommitted
Fix code styling
1 parent 5b85454 commit a4dd3c8

File tree

15 files changed

+57
-56
lines changed

15 files changed

+57
-56
lines changed

app/Filament/Resources/Articles/ArticleResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public static function getRelations(): array
3333
public static function getPages(): array
3434
{
3535
return [
36-
'index' => ListArticles::route('/')
36+
'index' => ListArticles::route('/'),
3737
];
3838
}
3939
}

app/Filament/Resources/Articles/Tables/ArticlesTable.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
use App\Models\Article;
66
use Filament\Actions\Action;
7-
use Filament\Actions\BulkActionGroup;
8-
use Filament\Actions\DeleteBulkAction;
97
use Filament\Tables\Columns\ImageColumn;
108
use Filament\Tables\Columns\TextColumn;
119
use Filament\Tables\Filters\Filter;
@@ -24,11 +22,11 @@ public static function configure(Table $table): Table
2422
->label('Author')
2523
->circular()
2624
->width('1%')
27-
->defaultImageUrl(fn(?string $state): string => $state ? sprintf('https://avatars.githubusercontent.com/u/%s', $state) : asset('images/laravelio-icon-gray.svg')),
25+
->defaultImageUrl(fn (?string $state): string => $state ? sprintf('https://avatars.githubusercontent.com/u/%s', $state) : asset('images/laravelio-icon-gray.svg')),
2826

2927
TextColumn::make('authorRelation.name')
3028
->label('')
31-
->description(fn(Article $article): ?string => $article->authorRelation->username),
29+
->description(fn (Article $article): ?string => $article->authorRelation->username),
3230

3331
TextColumn::make('title')
3432
->searchable(['title', 'slug', 'body']),
@@ -40,12 +38,12 @@ public static function configure(Table $table): Table
4038
])
4139
->filters([
4240
Filter::make('awaiting_approvals')
43-
->query(fn(Builder $query): Builder => $query->awaitingApproval())
44-
->default()
41+
->query(fn (Builder $query): Builder => $query->awaitingApproval())
42+
->default(),
4543
])
4644
->recordActions([
4745
Action::make('view')
48-
->url(fn(Article $article): string => route('articles.show', $article->slug()))
46+
->url(fn (Article $article): string => route('articles.show', $article->slug()))
4947
->openUrlInNewTab()
5048
->icon('heroicon-s-eye'),
5149
])

app/Filament/Resources/Replies/Tables/RepliesTable.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ public static function configure(Table $table): Table
2727
ImageColumn::make('authorRelation.github_id')
2828
->label('Author')
2929
->circular()
30-
->defaultImageUrl(fn(?string $state): string => $state ? sprintf('https://avatars.githubusercontent.com/u/%s', $state) : asset('images/laravelio-icon-gray.svg')),
30+
->defaultImageUrl(fn (?string $state): string => $state ? sprintf('https://avatars.githubusercontent.com/u/%s', $state) : asset('images/laravelio-icon-gray.svg')),
3131

3232
TextColumn::make('authorRelation.name')
3333
->label('')
34-
->description(fn(Reply $reply): ?string => $reply->authorRelation->username),
34+
->description(fn (Reply $reply): ?string => $reply->authorRelation->username),
3535

3636
TextColumn::make('replyAbleRelation.subject')
3737
->label('Thread')
@@ -64,11 +64,11 @@ public static function configure(Table $table): Table
6464

6565
TernaryFilter::make('updated_by')
6666
->label('Updated')
67-
->nullable()
67+
->nullable(),
6868
])
6969
->recordActions([
7070
Action::make('view')
71-
->url(fn(Reply $reply): string => route('thread', $reply->replyAble()->slug()) . '#' . $reply->id())
71+
->url(fn (Reply $reply): string => route('thread', $reply->replyAble()->slug()).'#'.$reply->id())
7272
->openUrlInNewTab()
7373
->icon('heroicon-s-eye'),
7474

app/Filament/Resources/Users/Tables/UsersTable.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ public static function configure(Table $table): Table
3434
->label('Name')
3535
->circular()
3636
->width('0%')
37-
->defaultImageUrl(fn(?string $state): string => $state ? sprintf('https://avatars.githubusercontent.com/u/%s', $state) : asset('images/laravelio-icon-gray.svg')),
37+
->defaultImageUrl(fn (?string $state): string => $state ? sprintf('https://avatars.githubusercontent.com/u/%s', $state) : asset('images/laravelio-icon-gray.svg')),
3838

3939
TextColumn::make('username')
4040
->label('')
4141
->searchable()
42-
->formatStateUsing(fn(User $user): ?string => $user->name)
43-
->description(fn(User $user): ?string => $user->username),
42+
->formatStateUsing(fn (User $user): ?string => $user->name)
43+
->description(fn (User $user): ?string => $user->username),
4444

4545
TextColumn::make('email')
4646
->searchable()
@@ -49,7 +49,7 @@ public static function configure(Table $table): Table
4949
TextColumn::make('type')
5050
->label('Role')
5151
->badge()
52-
->formatStateUsing(fn(string $state): string => match ($state) {
52+
->formatStateUsing(fn (string $state): string => match ($state) {
5353
'1' => 'User',
5454
'2' => 'Moderator',
5555
'3' => 'Admin',
@@ -63,7 +63,7 @@ public static function configure(Table $table): Table
6363
TextColumn::make('created_at')
6464
->label('Joined on')
6565
->dateTime()
66-
->sortable()
66+
->sortable(),
6767
])
6868
->filters([
6969
SelectFilter::make('type')
@@ -75,11 +75,11 @@ public static function configure(Table $table): Table
7575

7676
TernaryFilter::make('banned_at')
7777
->label('Banned')
78-
->nullable()
78+
->nullable(),
7979
])
8080
->recordActions([
8181
Action::make('view')
82-
->url(fn(User $user): string => route('profile', $user->username))
82+
->url(fn (User $user): string => route('profile', $user->username))
8383
->openUrlInNewTab()
8484
->icon('heroicon-s-eye'),
8585

@@ -89,30 +89,30 @@ public static function configure(Table $table): Table
8989
VerifyAuthor::dispatchSync($user);
9090

9191
Notification::make()
92-
->title($user->name . ' is now a verified author.')
92+
->title($user->name.' is now a verified author.')
9393
->success()
9494
->send();
9595
})
9696
->openUrlInNewTab()
9797
->color('primary')
9898
->icon('heroicon-s-check-circle')
9999
->requiresConfirmation()
100-
->visible(fn(User $user): bool => auth()->user()->can(UserPolicy::ADMIN, $user) && ! $user->isVerifiedAuthor()),
100+
->visible(fn (User $user): bool => auth()->user()->can(UserPolicy::ADMIN, $user) && ! $user->isVerifiedAuthor()),
101101

102102
Action::make('unverify_author')
103103
->action(function (User $user) {
104104
UnVerifyAuthor::dispatchSync($user);
105105

106106
Notification::make()
107-
->title($user->name . '\'s threads have been deleted.')
107+
->title($user->name.'\'s threads have been deleted.')
108108
->success()
109109
->send();
110110
})
111111
->openUrlInNewTab()
112112
->color('danger')
113113
->icon('heroicon-s-x-circle')
114114
->requiresConfirmation()
115-
->visible(fn(User $user): bool => auth()->user()->can(UserPolicy::ADMIN, $user) && $user->isVerifiedAuthor()),
115+
->visible(fn (User $user): bool => auth()->user()->can(UserPolicy::ADMIN, $user) && $user->isVerifiedAuthor()),
116116

117117
Action::make('ban_author')
118118
->schema([
@@ -134,7 +134,7 @@ public static function configure(Table $table): Table
134134

135135
Notification::make()
136136
->title(
137-
$user->name . ' is now banned.' . ($data['delete_threads'] ? ' And all his threads are now deleted.' : '')
137+
$user->name.' is now banned.'.($data['delete_threads'] ? ' And all his threads are now deleted.' : '')
138138
)
139139
->success()
140140
->send();
@@ -144,45 +144,45 @@ public static function configure(Table $table): Table
144144
->color('danger')
145145
->icon('heroicon-s-check-circle')
146146
->requiresConfirmation()
147-
->visible(fn(User $user): bool => auth()->user()->can(UserPolicy::BAN, $user) && ! $user->isBanned()),
147+
->visible(fn (User $user): bool => auth()->user()->can(UserPolicy::BAN, $user) && ! $user->isBanned()),
148148

149149
Action::make('unban_author')
150150
->action(function (User $user) {
151151

152152
UnbanUser::dispatchSync($user);
153153

154154
Notification::make()
155-
->title($user->name . ' is no longer a banned user.')
155+
->title($user->name.' is no longer a banned user.')
156156
->success()
157157
->send();
158158
})
159159
->openUrlInNewTab()
160160
->color('primary')
161161
->icon('heroicon-s-x-circle')
162162
->requiresConfirmation()
163-
->visible(fn(User $user): bool => auth()->user()->can(UserPolicy::BAN, $user) && $user->isBanned()),
163+
->visible(fn (User $user): bool => auth()->user()->can(UserPolicy::BAN, $user) && $user->isBanned()),
164164

165165
Action::make('delete_threads')
166166
->action(function (User $user) {
167167
DeleteUserThreads::dispatchSync($user);
168168

169169
Notification::make()
170-
->title($user->name . '\'s threads have been deleted.')
170+
->title($user->name.'\'s threads have been deleted.')
171171
->success()
172172
->send();
173173
})
174174
->openUrlInNewTab()
175175
->color('danger')
176176
->icon('heroicon-s-archive-box-x-mark')
177177
->requiresConfirmation()
178-
->visible(fn(User $user): bool => auth()->user()->can(UserPolicy::DELETE, $user)),
178+
->visible(fn (User $user): bool => auth()->user()->can(UserPolicy::DELETE, $user)),
179179

180180
DeleteAction::make()
181-
->visible(fn(User $user): bool => auth()->user()->can(UserPolicy::DELETE, $user)),
181+
->visible(fn (User $user): bool => auth()->user()->can(UserPolicy::DELETE, $user)),
182182
]),
183183
])
184184
->toolbarActions([
185-
//
185+
//
186186
]);
187187
}
188188
}

app/Filament/Widgets/ArticlesStatsOverview.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,30 @@ protected function getStats(): array
1616
$cacheTtlSeconds = 300; // 5 minutes
1717

1818
$total = cache()->remember(
19-
"widgets:articles:total",
19+
'widgets:articles:total',
2020
now()->addSeconds($cacheTtlSeconds),
21-
fn() => Article::query()->count(),
21+
fn () => Article::query()->count(),
2222
);
2323

2424
$publishedTotal = cache()->remember(
25-
"widgets:articles:published:total",
25+
'widgets:articles:published:total',
2626
now()->addSeconds($cacheTtlSeconds),
27-
fn() => Article::query()->published()->count(),
27+
fn () => Article::query()->published()->count(),
2828
);
2929

3030
$publishedWindow = cache()->remember(
3131
"widgets:articles:published:{$window}",
3232
now()->addSeconds($cacheTtlSeconds),
33-
fn() => Article::query()
33+
fn () => Article::query()
3434
->published()
3535
->where('submitted_at', '>=', now()->subDays($window))
3636
->count(),
3737
);
3838

3939
$awaiting = cache()->remember(
40-
"widgets:articles:awaiting",
40+
'widgets:articles:awaiting',
4141
now()->addSeconds(60),
42-
fn() => Article::query()->awaitingApproval()->count(),
42+
fn () => Article::query()->awaitingApproval()->count(),
4343
);
4444

4545
return [

app/Filament/Widgets/ArticlesTrendChart.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
class ArticlesTrendChart extends ChartWidget
1212
{
1313
protected ?string $heading = 'Articles per Month';
14+
1415
protected ?string $pollingInterval = '30s';
1516

1617
protected function getType(): string
@@ -32,11 +33,11 @@ protected function getData(): array
3233
'datasets' => [
3334
[
3435
'label' => 'Submitted',
35-
'data' => $data->map(fn(TrendValue $value) => $value->aggregate),
36+
'data' => $data->map(fn (TrendValue $value) => $value->aggregate),
3637
'tension' => 0.35,
3738
],
3839
],
39-
'labels' => $data->map(fn(TrendValue $value) => Carbon::parse($value->date)->format('M Y')),
40+
'labels' => $data->map(fn (TrendValue $value) => Carbon::parse($value->date)->format('M Y')),
4041
];
4142
}
4243
}

app/Filament/Widgets/RepliesStatsOverview.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ protected function getStats(): array
1818
$total = cache()->remember(
1919
'widgets:replies:total',
2020
now()->addSeconds($cacheTtlSeconds),
21-
fn() => Reply::query()->count(),
21+
fn () => Reply::query()->count(),
2222
);
2323

2424
$lastWindow = cache()->remember(
2525
"widgets:replies:new:{$window}",
2626
now()->addSeconds($cacheTtlSeconds),
27-
fn() => Reply::query()->where('created_at', '>=', now()->subDays($window))->count(),
27+
fn () => Reply::query()->where('created_at', '>=', now()->subDays($window))->count(),
2828
);
2929

3030
$solutions = cache()->remember(
3131
'widgets:replies:solutions',
3232
now()->addSeconds($cacheTtlSeconds),
33-
fn() => Reply::query()->isSolution()->count(),
33+
fn () => Reply::query()->isSolution()->count(),
3434
);
3535

3636
return [

app/Filament/Widgets/RepliesTrendChart.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
class RepliesTrendChart extends ChartWidget
1212
{
1313
protected ?string $heading = 'Replies per Month';
14+
1415
protected ?string $pollingInterval = '30s';
1516

1617
protected function getType(): string
@@ -32,11 +33,11 @@ protected function getData(): array
3233
'datasets' => [
3334
[
3435
'label' => 'Submitted',
35-
'data' => $data->map(fn(TrendValue $value) => $value->aggregate),
36+
'data' => $data->map(fn (TrendValue $value) => $value->aggregate),
3637
'tension' => 0.35,
3738
],
3839
],
39-
'labels' => $data->map(fn(TrendValue $value) => Carbon::parse($value->date)->format('M Y')),
40+
'labels' => $data->map(fn (TrendValue $value) => Carbon::parse($value->date)->format('M Y')),
4041
];
4142
}
4243
}

app/Filament/Widgets/UsersStatsOverview.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ protected function getStats(): array
1919
$total = cache()->remember(
2020
'widgets:users:total',
2121
now()->addSeconds($cacheTtlSeconds),
22-
fn() => User::query()->count(),
22+
fn () => User::query()->count(),
2323
);
2424

2525
$lastWindow = cache()->remember(
2626
"widgets:users:new:{$window}",
2727
now()->addSeconds($cacheTtlSeconds),
28-
fn() => User::query()->where('created_at', '>=', now()->subDays($window))->count(),
28+
fn () => User::query()->where('created_at', '>=', now()->subDays($window))->count(),
2929
);
3030

3131
$verified = cache()->remember(
3232
'widgets:users:verified',
3333
now()->addSeconds($cacheTtlSeconds),
34-
fn() => User::query()->whereNotNull('author_verified_at')->count(),
34+
fn () => User::query()->whereNotNull('author_verified_at')->count(),
3535
);
3636

3737
return [

app/Filament/Widgets/UsersTrendChart.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
class UsersTrendChart extends ChartWidget
1212
{
1313
protected ?string $heading = 'New Users per Month';
14+
1415
protected ?string $pollingInterval = '30s';
1516

1617
protected function getType(): string
@@ -32,11 +33,11 @@ protected function getData(): array
3233
'datasets' => [
3334
[
3435
'label' => 'Submitted',
35-
'data' => $data->map(fn(TrendValue $value) => $value->aggregate),
36+
'data' => $data->map(fn (TrendValue $value) => $value->aggregate),
3637
'tension' => 0.35,
3738
],
3839
],
39-
'labels' => $data->map(fn(TrendValue $value) => Carbon::parse($value->date)->format('M Y')),
40+
'labels' => $data->map(fn (TrendValue $value) => Carbon::parse($value->date)->format('M Y')),
4041
];
4142
}
4243
}

0 commit comments

Comments
 (0)