Skip to content

Commit 446474d

Browse files
committed
Add inlineLabel and columns(1) to all Filament resource forms and infolists
1 parent 74e9ad7 commit 446474d

14 files changed

Lines changed: 111 additions & 46 deletions

app/Filament/Resources/ArticleResource.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ class ArticleResource extends Resource
3333
public static function form(Schema $schema): Schema
3434
{
3535
return $schema
36+
->inlineLabel()
37+
->columns(1)
3638
->schema([
3739
TextInput::make('title')
3840
->required()

app/Filament/Resources/LeadResource.php

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Filament\Actions;
88
use Filament\Infolists;
99
use Filament\Resources\Resource;
10+
use Filament\Schemas;
1011
use Filament\Schemas\Schema;
1112
use Filament\Tables;
1213
use Filament\Tables\Table;
@@ -29,8 +30,12 @@ public static function canCreate(): bool
2930
public static function infolist(Schema $schema): Schema
3031
{
3132
return $schema
33+
->inlineLabel()
34+
->columns(1)
3235
->schema([
33-
Infolists\Components\Section::make('Contact Information')
36+
Schemas\Components\Section::make('Contact Information')
37+
->inlineLabel()
38+
->columns(1)
3439
->schema([
3540
Infolists\Components\TextEntry::make('name')
3641
->label('Name'),
@@ -39,27 +44,28 @@ public static function infolist(Schema $schema): Schema
3944
->copyable(),
4045
Infolists\Components\TextEntry::make('company')
4146
->label('Company'),
42-
])
43-
->columns(3),
47+
]),
4448

45-
Infolists\Components\Section::make('Project Details')
49+
Schemas\Components\Section::make('Project Details')
50+
->inlineLabel()
51+
->columns(1)
4652
->schema([
4753
Infolists\Components\TextEntry::make('budget_label')
4854
->label('Budget'),
4955
Infolists\Components\TextEntry::make('description')
50-
->label('App Description')
51-
->columnSpanFull(),
56+
->label('App Description'),
5257
]),
5358

54-
Infolists\Components\Section::make('Metadata')
59+
Schemas\Components\Section::make('Metadata')
60+
->inlineLabel()
61+
->columns(1)
5562
->schema([
5663
Infolists\Components\TextEntry::make('ip_address')
5764
->label('IP Address'),
5865
Infolists\Components\TextEntry::make('created_at')
5966
->label('Submitted')
6067
->dateTime(),
6168
])
62-
->columns(2)
6369
->collapsed(),
6470
]);
6571
}

app/Filament/Resources/LicenseResource.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,12 @@ class LicenseResource extends Resource
2222
public static function form(Schema $schema): Schema
2323
{
2424
return $schema
25+
->inlineLabel()
26+
->columns(1)
2527
->schema([
2628
Schemas\Components\Section::make('License Information')
29+
->inlineLabel()
30+
->columns(1)
2731
->schema([
2832
Forms\Components\TextInput::make('id')
2933
->disabled(),
@@ -49,8 +53,7 @@ public static function form(Schema $schema): Schema
4953
Forms\Components\Toggle::make('is_suspended')
5054
->label('Suspended')
5155
->disabled(),
52-
])
53-
->columns(2),
56+
]),
5457
]);
5558
}
5659

app/Filament/Resources/OpenCollectiveDonationResource.php

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Filament\Actions;
88
use Filament\Infolists;
99
use Filament\Resources\Resource;
10+
use Filament\Schemas;
1011
use Filament\Schemas\Schema;
1112
use Filament\Tables;
1213
use Filament\Tables\Table;
@@ -37,8 +38,12 @@ public static function canCreate(): bool
3738
public static function infolist(Schema $schema): Schema
3839
{
3940
return $schema
41+
->inlineLabel()
42+
->columns(1)
4043
->schema([
41-
Infolists\Components\Section::make('Donation Details')
44+
Schemas\Components\Section::make('Donation Details')
45+
->inlineLabel()
46+
->columns(1)
4247
->schema([
4348
Infolists\Components\TextEntry::make('order_id')
4449
->label('Order ID')
@@ -53,8 +58,10 @@ public static function infolist(Schema $schema): Schema
5358
Infolists\Components\TextEntry::make('created_at')
5459
->label('Received')
5560
->dateTime(),
56-
])->columns(2),
57-
Infolists\Components\Section::make('Contributor')
61+
]),
62+
Schemas\Components\Section::make('Contributor')
63+
->inlineLabel()
64+
->columns(1)
5865
->schema([
5966
Infolists\Components\TextEntry::make('from_collective_name')
6067
->label('Name'),
@@ -64,8 +71,10 @@ public static function infolist(Schema $schema): Schema
6471
->openUrlInNewTab(),
6572
Infolists\Components\TextEntry::make('from_collective_id')
6673
->label('Collective ID'),
67-
])->columns(3),
68-
Infolists\Components\Section::make('Claim Status')
74+
]),
75+
Schemas\Components\Section::make('Claim Status')
76+
->inlineLabel()
77+
->columns(1)
6978
->schema([
7079
Infolists\Components\IconEntry::make('claimed_at')
7180
->label('Claimed')
@@ -82,7 +91,7 @@ public static function infolist(Schema $schema): Schema
8291
->label('Claimed By')
8392
->placeholder('Not claimed')
8493
->url(fn ($record) => $record->user_id ? UserResource::getUrl('edit', ['record' => $record->user_id]) : null),
85-
])->columns(3),
94+
]),
8695
]);
8796
}
8897

app/Filament/Resources/PluginBundleResource.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,12 @@ class PluginBundleResource extends Resource
3535
public static function form(Schema $schema): Schema
3636
{
3737
return $schema
38+
->inlineLabel()
39+
->columns(1)
3840
->schema([
3941
Schemas\Components\Section::make('Bundle Details')
42+
->inlineLabel()
43+
->columns(1)
4044
->schema([
4145
Forms\Components\TextInput::make('name')
4246
->required()
@@ -54,8 +58,7 @@ public static function form(Schema $schema): Schema
5458

5559
Forms\Components\Textarea::make('description')
5660
->rows(3)
57-
->maxLength(1000)
58-
->columnSpanFull(),
61+
->maxLength(1000),
5962

6063
Forms\Components\FileUpload::make('logo_path')
6164
->label('Bundle Logo')
@@ -66,10 +69,11 @@ public static function form(Schema $schema): Schema
6669
->imageCropAspectRatio('1:1')
6770
->imageResizeTargetWidth('256')
6871
->imageResizeTargetHeight('256'),
69-
])
70-
->columns(2),
72+
]),
7173

7274
Schemas\Components\Section::make('Included Plugins')
75+
->inlineLabel()
76+
->columns(1)
7377
->schema([
7478
Forms\Components\Select::make('plugins')
7579
->relationship(
@@ -91,6 +95,8 @@ public static function form(Schema $schema): Schema
9195
]),
9296

9397
Schemas\Components\Section::make('Publishing')
98+
->inlineLabel()
99+
->columns(1)
94100
->schema([
95101
Forms\Components\Toggle::make('is_active')
96102
->label('Active')
@@ -103,8 +109,7 @@ public static function form(Schema $schema): Schema
103109
Forms\Components\DateTimePicker::make('published_at')
104110
->label('Publish Date')
105111
->helperText('Leave empty to keep as draft. Set future date to schedule.'),
106-
])
107-
->columns(3),
112+
]),
108113
]);
109114
}
110115

app/Filament/Resources/ProductResource.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,12 @@ class ProductResource extends Resource
3333
public static function form(Schema $schema): Schema
3434
{
3535
return $schema
36+
->inlineLabel()
37+
->columns(1)
3638
->schema([
3739
Schemas\Components\Section::make('Product Details')
40+
->inlineLabel()
41+
->columns(1)
3842
->schema([
3943
Forms\Components\TextInput::make('name')
4044
->required()
@@ -52,8 +56,7 @@ public static function form(Schema $schema): Schema
5256

5357
Forms\Components\Textarea::make('description')
5458
->rows(3)
55-
->maxLength(1000)
56-
->columnSpanFull(),
59+
->maxLength(1000),
5760

5861
Forms\Components\FileUpload::make('logo_path')
5962
->label('Product Logo')
@@ -64,10 +67,11 @@ public static function form(Schema $schema): Schema
6467
->imageCropAspectRatio('1:1')
6568
->imageResizeTargetWidth('256')
6669
->imageResizeTargetHeight('256'),
67-
])
68-
->columns(2),
70+
]),
6971

7072
Schemas\Components\Section::make('GitHub Integration')
73+
->inlineLabel()
74+
->columns(1)
7175
->schema([
7276
Forms\Components\TextInput::make('github_repo')
7377
->label('GitHub Repository Name')
@@ -77,6 +81,8 @@ public static function form(Schema $schema): Schema
7781
]),
7882

7983
Schemas\Components\Section::make('Publishing')
84+
->inlineLabel()
85+
->columns(1)
8086
->schema([
8187
Forms\Components\Toggle::make('is_active')
8288
->label('Active')
@@ -89,8 +95,7 @@ public static function form(Schema $schema): Schema
8995
Forms\Components\DateTimePicker::make('published_at')
9096
->label('Publish Date')
9197
->helperText('Leave empty to keep as draft. Set future date to schedule.'),
92-
])
93-
->columns(3),
98+
]),
9499
]);
95100
}
96101

app/Filament/Resources/ShowcaseResource.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,12 @@ class ShowcaseResource extends Resource
2626
public static function form(Schema $schema): Schema
2727
{
2828
return $schema
29+
->inlineLabel()
30+
->columns(1)
2931
->schema([
3032
Schemas\Components\Section::make('App Details')
33+
->inlineLabel()
34+
->columns(1)
3135
->schema([
3236
Forms\Components\Select::make('user_id')
3337
->label('Submitted By')
@@ -62,6 +66,8 @@ public static function form(Schema $schema): Schema
6266
]),
6367

6468
Schemas\Components\Section::make('Platform Availability')
69+
->inlineLabel()
70+
->columns(1)
6571
->schema([
6672
Forms\Components\Toggle::make('has_mobile')
6773
->label('Mobile App')
@@ -106,6 +112,8 @@ public static function form(Schema $schema): Schema
106112
]),
107113

108114
Schemas\Components\Section::make('Certification')
115+
->inlineLabel()
116+
->columns(1)
109117
->schema([
110118
Forms\Components\Toggle::make('certified_nativephp')
111119
->label('Certified as built with NativePHP')

app/Filament/Resources/SubscriptionItemResource.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,12 @@ class SubscriptionItemResource extends Resource
2525
public static function form(Schema $schema): Schema
2626
{
2727
return $schema
28+
->inlineLabel()
29+
->columns(1)
2830
->schema([
2931
Schemas\Components\Section::make('Subscription Item Details')
32+
->inlineLabel()
33+
->columns(1)
3034
->schema([
3135
Forms\Components\Select::make('subscription_id')
3236
->relationship('subscription', 'id')
@@ -40,7 +44,7 @@ public static function form(Schema $schema): Schema
4044
->disabled(),
4145
Forms\Components\TextInput::make('quantity')
4246
->disabled(),
43-
])->columns(2),
47+
]),
4448
]);
4549
}
4650

app/Filament/Resources/SubscriptionItemResource/Pages/ViewSubscriptionItem.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,12 @@ protected function getHeaderActions(): array
7979
public function infolist(Schema $schema): Schema
8080
{
8181
return $schema
82+
->inlineLabel()
83+
->columns(1)
8284
->schema([
8385
Section::make('Subscription Item Details')
86+
->inlineLabel()
87+
->columns(1)
8488
->schema([
8589
Components\TextEntry::make('subscription.id')
8690
->label('Subscription ID')
@@ -109,7 +113,7 @@ public function infolist(Schema $schema): Schema
109113
->dateTime(),
110114
Components\TextEntry::make('updated_at')
111115
->dateTime(),
112-
])->columns(2),
116+
]),
113117
]);
114118
}
115119
}

app/Filament/Resources/SubscriptionResource.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,12 @@ class SubscriptionResource extends Resource
2828
public static function form(Schema $schema): Schema
2929
{
3030
return $schema
31+
->inlineLabel()
32+
->columns(1)
3133
->schema([
3234
Schemas\Components\Section::make('Subscription Details')
35+
->inlineLabel()
36+
->columns(1)
3337
->schema([
3438
Forms\Components\Select::make('user_id')
3539
->relationship('user', 'email')
@@ -49,7 +53,7 @@ public static function form(Schema $schema): Schema
4953
->disabled(),
5054
Forms\Components\DateTimePicker::make('ends_at')
5155
->disabled(),
52-
])->columns(2),
56+
]),
5357
]);
5458
}
5559

0 commit comments

Comments
 (0)