Skip to content

Commit b1a0eb2

Browse files
AzGasimgithub-actions[bot]
authored andcommitted
Fix styling
1 parent 034a61b commit b1a0eb2

File tree

4 files changed

+75
-75
lines changed

4 files changed

+75
-75
lines changed

packages/category/src/Moox/Entities/Categories/Category/CategoryResource.php

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@ public static function form(Schema $schema): Schema
8888
relationship: 'parent',
8989
titleAttribute: 'title',
9090
parentAttribute: 'parent_id',
91-
modifyQueryUsing: fn(Builder $query, $get) => $query->where('id', '!=', $get('id'))
91+
modifyQueryUsing: fn (Builder $query, $get) => $query->where('id', '!=', $get('id'))
9292
)
9393
->label('Parent Category')
9494
->searchable()
95-
->disabledOptions(fn($get): array => [$get('id')])
95+
->disabledOptions(fn ($get): array => [$get('id')])
9696
->enableBranchNode()
97-
->visible(fn() => Category::count() > 0),
97+
->visible(fn () => Category::count() > 0),
9898
])
9999
->columnSpan(2),
100100
Grid::make()
@@ -109,16 +109,16 @@ public static function form(Schema $schema): Schema
109109
TextInput::make('weight')->numeric(),
110110
TextInput::make('count')
111111
->disabled()
112-
->visible(fn($livewire, $record): bool => ($record && $livewire instanceof EditCategory) || ($record && $livewire instanceof ViewCategory)),
112+
->visible(fn ($livewire, $record): bool => ($record && $livewire instanceof EditCategory) || ($record && $livewire instanceof ViewCategory)),
113113
DateTimePicker::make('created_at')
114114
->disabled()
115-
->visible(fn($livewire, $record): bool => ($record && $livewire instanceof EditCategory) || ($record && $livewire instanceof ViewCategory)),
115+
->visible(fn ($livewire, $record): bool => ($record && $livewire instanceof EditCategory) || ($record && $livewire instanceof ViewCategory)),
116116
DateTimePicker::make('updated_at')
117117
->disabled()
118-
->visible(fn($livewire, $record): bool => ($record && $livewire instanceof EditCategory) || ($record && $livewire instanceof ViewCategory)),
118+
->visible(fn ($livewire, $record): bool => ($record && $livewire instanceof EditCategory) || ($record && $livewire instanceof ViewCategory)),
119119
DateTimePicker::make('deleted_at')
120120
->disabled()
121-
->visible(fn($livewire, $record): bool => $record && $record->trashed() && $livewire instanceof ViewCategory),
121+
->visible(fn ($livewire, $record): bool => $record && $record->trashed() && $livewire instanceof ViewCategory),
122122
]),
123123
])
124124
->columnSpan(1)
@@ -135,7 +135,7 @@ public static function table(Table $table): Table
135135
$currentTab = static::getCurrentTab();
136136

137137
return $table
138-
->query(fn(): Builder => static::getEloquentQuery())
138+
->query(fn (): Builder => static::getEloquentQuery())
139139
->defaultSort('_lft', 'asc')
140140
->columns([
141141
TextColumn::make('id')->sortable(),
@@ -172,7 +172,7 @@ public static function table(Table $table): Table
172172
}),
173173
TextColumn::make('level')
174174
->label(__('category::fields.level'))
175-
->getStateUsing(fn(Category $record): int => $record->ancestors->count() + 1)
175+
->getStateUsing(fn (Category $record): int => $record->ancestors->count() + 1)
176176
->sortable()
177177
->toggleable(isToggledHiddenByDefault: true),
178178
TextColumn::make('children_count')
@@ -214,16 +214,16 @@ public static function table(Table $table): Table
214214
->defaultSort('updated_at', 'desc')
215215
->recordActions([
216216
ViewAction::make(),
217-
EditAction::make()->hidden(fn(): bool => in_array(static::getCurrentTab(), ['trash', 'deleted'])),
217+
EditAction::make()->hidden(fn (): bool => in_array(static::getCurrentTab(), ['trash', 'deleted'])),
218218
])
219219
->toolbarActions([
220-
DeleteBulkAction::make()->hidden(fn(): bool => in_array($currentTab, ['trash', 'deleted'])),
221-
RestoreBulkAction::make()->visible(fn(): bool => in_array($currentTab, ['trash', 'deleted'])),
220+
DeleteBulkAction::make()->hidden(fn (): bool => in_array($currentTab, ['trash', 'deleted'])),
221+
RestoreBulkAction::make()->visible(fn (): bool => in_array($currentTab, ['trash', 'deleted'])),
222222
])
223223
->filters([
224224
SelectFilter::make('parent_id')
225225
->label(__('category::fields.parent'))
226-
->relationship('parent', 'title', fn($query) => $query->has('children'))
226+
->relationship('parent', 'title', fn ($query) => $query->has('children'))
227227
->searchable(),
228228
SelectFilter::make('children_count')
229229
->label(__('category::fields.children_count'))
@@ -233,7 +233,7 @@ public static function table(Table $table): Table
233233
'6-10' => '6-10',
234234
'10+' => '10+',
235235
])
236-
->query(fn(Builder $query, array $data) => $query->when($data['value'], function ($query, $option) {
236+
->query(fn (Builder $query, array $data) => $query->when($data['value'], function ($query, $option) {
237237
switch ($option) {
238238
case '0':
239239
return $query->doesntHave('children');
@@ -247,8 +247,8 @@ public static function table(Table $table): Table
247247
})),
248248
SelectFilter::make('depth')
249249
->label(__('category::fields.level'))
250-
->options(fn(): array => array_combine(range(1, 5), range(1, 5)))
251-
->query(fn(Builder $query, array $data) => $query->when($data['value'], function ($query, $depth): void {
250+
->options(fn (): array => array_combine(range(1, 5), range(1, 5)))
251+
->query(fn (Builder $query, array $data) => $query->when($data['value'], function ($query, $depth): void {
252252
$query->whereIn('id', function ($subquery) use ($depth): void {
253253
$subquery->select('id')
254254
->from('categories as c')
@@ -259,16 +259,16 @@ public static function table(Table $table): Table
259259
->defaultSort('id', 'asc')
260260
->recordActions([
261261
ViewAction::make(),
262-
EditAction::make()->hidden(fn(): bool => in_array(static::getCurrentTab(), ['trash', 'deleted'])),
262+
EditAction::make()->hidden(fn (): bool => in_array(static::getCurrentTab(), ['trash', 'deleted'])),
263263
])
264264
->toolbarActions([
265-
DeleteBulkAction::make()->hidden(fn(): bool => in_array($currentTab, ['trash', 'deleted'])),
266-
RestoreBulkAction::make()->visible(fn(): bool => in_array($currentTab, ['trash', 'deleted'])),
265+
DeleteBulkAction::make()->hidden(fn (): bool => in_array($currentTab, ['trash', 'deleted'])),
266+
RestoreBulkAction::make()->visible(fn (): bool => in_array($currentTab, ['trash', 'deleted'])),
267267
])
268268
->filters([
269269
SelectFilter::make('parent_id')
270270
->label(__('category::fields.parent'))
271-
->relationship('parent', 'title', fn($query) => $query->has('children'))
271+
->relationship('parent', 'title', fn ($query) => $query->has('children'))
272272
->searchable(),
273273
SelectFilter::make('children_count')
274274
->label(__('category::fields.children_count'))
@@ -278,7 +278,7 @@ public static function table(Table $table): Table
278278
'6-10' => '6-10',
279279
'10+' => '10+',
280280
])
281-
->query(fn(Builder $query, array $data) => $query->when($data['value'], function ($query, $option) {
281+
->query(fn (Builder $query, array $data) => $query->when($data['value'], function ($query, $option) {
282282
switch ($option) {
283283
case '0':
284284
return $query->doesntHave('children');
@@ -292,8 +292,8 @@ public static function table(Table $table): Table
292292
})),
293293
SelectFilter::make('depth')
294294
->label(__('category::fields.level'))
295-
->options(fn(): array => array_combine(range(1, 5), range(1, 5)))
296-
->query(fn(Builder $query, array $data) => $query->when($data['value'], function ($query, $depth): void {
295+
->options(fn (): array => array_combine(range(1, 5), range(1, 5)))
296+
->query(fn (Builder $query, array $data) => $query->when($data['value'], function ($query, $depth): void {
297297
$query->whereIn('id', function ($subquery) use ($depth): void {
298298
$subquery->select('id')
299299
->from('categories as c')

packages/draft/src/Moox/Entities/Drafts/Draft/DraftResource.php

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,13 @@ public static function form(Schema $form): Schema
140140
DateTimePicker::make('to_publish_at')
141141
->label('To publish at')
142142
->placeholder(__('core::core.to_publish_at'))
143-
->hidden(fn($get) => $get('status') !== 'scheduled')
144-
->dehydrateStateUsing(fn($state, $get) => $get('status') === 'scheduled' ? $state : null),
143+
->hidden(fn ($get) => $get('status') !== 'scheduled')
144+
->dehydrateStateUsing(fn ($state, $get) => $get('status') === 'scheduled' ? $state : null),
145145
DateTimePicker::make('to_unpublish_at')
146146
->label('To unpublish at')
147147
->placeholder(__('core::core.to_unpublish_at'))
148-
->hidden(fn($get) => !in_array($get('status'), ['scheduled', 'published']))
149-
->dehydrateStateUsing(fn($state, $get) => in_array($get('status'), ['scheduled', 'published']) ? $state : null),
148+
->hidden(fn ($get) => ! in_array($get('status'), ['scheduled', 'published']))
149+
->dehydrateStateUsing(fn ($state, $get) => in_array($get('status'), ['scheduled', 'published']) ? $state : null),
150150
]),
151151
Section::make('')
152152
->schema($taxonomyFields),
@@ -164,41 +164,41 @@ public static function form(Schema $form): Schema
164164
->schema([
165165
CopyableField::make('id')
166166
->label('ID')
167-
->defaultValue(fn($record): string => $record->id ?? ''),
167+
->defaultValue(fn ($record): string => $record->id ?? ''),
168168
CopyableField::make('uuid')
169169
->label('UUID')
170-
->defaultValue(fn($record): string => $record->uuid ?? ''),
170+
->defaultValue(fn ($record): string => $record->uuid ?? ''),
171171
CopyableField::make('ulid')
172172
->label('ULID')
173-
->defaultValue(fn($record): string => $record->ulid ?? ''),
173+
->defaultValue(fn ($record): string => $record->ulid ?? ''),
174174
Section::make('')
175175
->schema([
176176
Placeholder::make('created_at')
177177
->label('Created')
178-
->content(fn($record): string => $record->created_at ?
179-
$record->created_at . ' - ' . $record->created_at->diffForHumans() : '')
178+
->content(fn ($record): string => $record->created_at ?
179+
$record->created_at.' - '.$record->created_at->diffForHumans() : '')
180180
->extraAttributes(['class' => 'font-mono']),
181181
Placeholder::make('updated_at')
182182
->label('Last Updated')
183-
->content(fn($record): string => $record->updated_at ?
184-
$record->updated_at . ' - ' . $record->updated_at->diffForHumans() : '')
183+
->content(fn ($record): string => $record->updated_at ?
184+
$record->updated_at.' - '.$record->updated_at->diffForHumans() : '')
185185
->extraAttributes(['class' => 'font-mono']),
186186
Placeholder::make('published_at')
187187
->label('Published')
188-
->content(fn($record): string => $record->published_at ?
189-
$record->published_at . ' - ' . $record->published_at->diffForHumans() .
190-
($record->published_by_id ? ' by ' . $record->published_by_id : '') : '')
188+
->content(fn ($record): string => $record->published_at ?
189+
$record->published_at.' - '.$record->published_at->diffForHumans().
190+
($record->published_by_id ? ' by '.$record->published_by_id : '') : '')
191191
->extraAttributes(['class' => 'font-mono'])
192-
->hidden(fn($record) => !$record->published_at),
192+
->hidden(fn ($record) => ! $record->published_at),
193193
Placeholder::make('to_unpublish_at')
194194
->label('To Unpublish')
195-
->content(fn($record): string => $record->to_unpublish_at ?
196-
$record->to_unpublish_at . ' - ' . $record->to_unpublish_at->diffForHumans() : '')
195+
->content(fn ($record): string => $record->to_unpublish_at ?
196+
$record->to_unpublish_at.' - '.$record->to_unpublish_at->diffForHumans() : '')
197197
->extraAttributes(['class' => 'font-mono'])
198-
->hidden(fn($record) => !$record->to_unpublish_at),
198+
->hidden(fn ($record) => ! $record->to_unpublish_at),
199199
]),
200200
])
201-
->hidden(fn($record) => $record === null),
201+
->hidden(fn ($record) => $record === null),
202202
])
203203
->columnSpan(1)
204204
->columns(1),
@@ -298,32 +298,32 @@ public static function table(Table $table): Table
298298
->schema([
299299
TextInput::make('title')
300300
->label('Title')
301-
->placeholder(__('core::core.filter') . ' Title'),
301+
->placeholder(__('core::core.filter').' Title'),
302302
])
303303
->query(function (Builder $query, array $data): Builder {
304304
return $query->when(
305305
$data['title'],
306-
fn(Builder $query, $value): Builder => $query->where('title', 'like', "%{$value}%"),
306+
fn (Builder $query, $value): Builder => $query->where('title', 'like', "%{$value}%"),
307307
);
308308
})
309309
->indicateUsing(function (array $data): ?string {
310-
if (!$data['title']) {
310+
if (! $data['title']) {
311311
return null;
312312
}
313313

314-
return 'Title: ' . $data['title'];
314+
return 'Title: '.$data['title'];
315315
}),
316316
SelectFilter::make('status')
317317
->label('Status')
318-
->placeholder(__('core::core.filter') . ' Status')
318+
->placeholder(__('core::core.filter').' Status')
319319
->options(['Probably' => 'Probably', 'Never' => 'Never', 'Done' => 'Done', 'Maybe' => 'Maybe']),
320320
SelectFilter::make('type')
321321
->label('Type')
322-
->placeholder(__('core::core.filter') . ' Type')
322+
->placeholder(__('core::core.filter').' Type')
323323
->options(['Post' => 'Post', 'Page' => 'Page']),
324324
SelectFilter::make('section')
325325
->label('Section')
326-
->placeholder(__('core::core.filter') . ' Section')
326+
->placeholder(__('core::core.filter').' Section')
327327
->options(['Header' => 'Header', 'Main' => 'Main', 'Footer' => 'Footer']),
328328
]);
329329
}

0 commit comments

Comments
 (0)