Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
atmonshi authored and github-actions[bot] committed Aug 6, 2023
1 parent 5a890e2 commit 48280f3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
14 changes: 7 additions & 7 deletions src/Filament/Resources/PageResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public static function form(Form $form): Form
->hint(__('Write an excerpt for your post')),

TextInput::make('slug')
->unique(ignorable: fn(?Post $record): ?Post => $record)
->unique(ignorable: fn (?Post $record): ?Post => $record)
->required()
->maxLength(255)
->label(__('Post Slug')),
Expand All @@ -116,7 +116,7 @@ public static function form(Form $form): Form

TextInput::make('password')
->label(__('Password'))
->visible(fn(Get $get): bool => $get('status') === 'private'),
->visible(fn (Get $get): bool => $get('status') === 'private'),

DateTimePicker::make('published_at')
->label(__('published at'))
Expand All @@ -140,11 +140,11 @@ public static function form(Form $form): Form
->inline(),
SpatieMediaLibraryFileUpload::make('featured_image_upload')
->collection('pages')
->visible(fn(Get $get) => $get('featured_image_type') === 'upload')
->visible(fn (Get $get) => $get('featured_image_type') === 'upload')
->label(''),
TextInput::make('featured_image')
->label(__('featured image url'))
->visible(fn(Get $get) => $get('featured_image_type') === 'url')
->visible(fn (Get $get) => $get('featured_image_type') === 'url')
->url(),
]),
])->columnSpan(2),
Expand All @@ -168,7 +168,7 @@ public static function table(Table $table): Table
->searchable(['status'])
->toggleable()
->view('zeus::filament.columns.status-desc')
->tooltip(fn(Post $record): string => $record->published_at->format('Y/m/d | H:i A')),
->tooltip(fn (Post $record): string => $record->published_at->format('Y/m/d | H:i A')),
])
->defaultSort('id', 'desc')
->actions([
Expand All @@ -178,7 +178,7 @@ public static function table(Table $table): Table
->color('warning')
->icon('heroicon-o-arrow-top-right-on-square')
->label(__('Open'))
->url(fn(Post $record): string => route('page', ['slug' => $record]))
->url(fn (Post $record): string => route('page', ['slug' => $record]))
->openUrlInNewTab(),
DeleteAction::make('delete'),
ForceDeleteAction::make(),
Expand All @@ -198,7 +198,7 @@ public static function table(Table $table): Table
->options(SkyPlugin::get()->getPostStatusModel()::pluck('label', 'name')),
Filter::make('password')
->label(__('Password Protected'))
->query(fn(Builder $query): Builder => $query->whereNotNull('password')),
->query(fn (Builder $query): Builder => $query->whereNotNull('password')),
]);
}

Expand Down
20 changes: 10 additions & 10 deletions src/Filament/Resources/PostResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public static function form(Form $form): Form
->hint(__('Write an excerpt for your post')),

TextInput::make('slug')
->unique(ignorable: fn(?Post $record): ?Post => $record)
->unique(ignorable: fn (?Post $record): ?Post => $record)
->required()
->maxLength(255)
->label(__('Post Slug')),
Expand All @@ -112,7 +112,7 @@ public static function form(Form $form): Form

TextInput::make('password')
->label(__('Password'))
->visible(fn(Get $get): bool => $get('status') === 'private'),
->visible(fn (Get $get): bool => $get('status') === 'private'),

DateTimePicker::make('published_at')
->label(__('published at'))
Expand Down Expand Up @@ -143,12 +143,12 @@ public static function form(Form $form): Form

SpatieMediaLibraryFileUpload::make('featured_image_upload')
->collection('posts')
->visible(fn(Get $get) => $get('featured_image_type') === 'upload')
->visible(fn (Get $get) => $get('featured_image_type') === 'upload')
->label(''),

TextInput::make('featured_image')
->label(__('featured image url'))
->visible(fn(Get $get) => $get('featured_image_type') === 'url')
->visible(fn (Get $get) => $get('featured_image_type') === 'url')
->url(),
]),
])->columnSpan(2),
Expand All @@ -172,7 +172,7 @@ public static function table(Table $table): Table
->searchable(['status'])
->toggleable()
->view('zeus::filament.columns.status-desc')
->tooltip(fn(Post $record): string => $record->published_at->format('Y/m/d | H:i A')),
->tooltip(fn (Post $record): string => $record->published_at->format('Y/m/d | H:i A')),

SpatieTagsColumn::make('tags')
->label(__('Post Tags'))
Expand All @@ -192,7 +192,7 @@ public static function table(Table $table): Table
->color('warning')
->icon('heroicon-o-arrow-top-right-on-square')
->label(__('Open'))
->url(fn(Post $record): string => route('post', ['slug' => $record]))
->url(fn (Post $record): string => route('post', ['slug' => $record]))
->openUrlInNewTab(),
DeleteAction::make('delete'),
ForceDeleteAction::make(),
Expand All @@ -213,25 +213,25 @@ public static function table(Table $table): Table

Filter::make('password')
->label(__('Password Protected'))
->query(fn(Builder $query): Builder => $query->whereNotNull('password')),
->query(fn (Builder $query): Builder => $query->whereNotNull('password')),

Filter::make('sticky')
->label(__('Still Sticky'))
// @phpstan-ignore-next-line
->query(fn(Builder $query): Builder => $query->sticky()),
->query(fn (Builder $query): Builder => $query->sticky()),

Filter::make('not_sticky')
->label(__('Not Sticky'))
->query(
fn(Builder $query): Builder => $query
fn (Builder $query): Builder => $query
->whereDate('sticky_until', '<=', now())
->orWhereNull('sticky_until')
),

Filter::make('sticky_only')
->label(__('Sticky Only'))
->query(
fn(Builder $query): Builder => $query
fn (Builder $query): Builder => $query
->where('post_type', 'post')
->whereNotNull('sticky_until')
),
Expand Down
4 changes: 2 additions & 2 deletions src/Filament/Resources/TagResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static function form(Form $form): Form
$set('slug', Str::slug($state));
}),
TextInput::make('slug')
->unique(ignorable: fn(?Model $record): ?Model => $record)
->unique(ignorable: fn (?Model $record): ?Model => $record)
->required()
->maxLength(255),
Select::make('type')
Expand All @@ -61,7 +61,7 @@ public static function table(Table $table): Table
TextColumn::make('items_count')
->toggleable()
->getStateUsing(
fn(Tag $record): int => method_exists($record, $record->type)
fn (Tag $record): int => method_exists($record, $record->type)
? $record->{$record->type}()->count()
: 0
),
Expand Down

0 comments on commit 48280f3

Please sign in to comment.