Skip to content

Commit 399c6b4

Browse files
Baspagithub-actions[bot]
authored andcommitted
Fix styling
1 parent 2f68ed0 commit 399c6b4

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/Fields/Base.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
use Filament\Schemas\Components\Grid;
1313
use Filament\Schemas\Components\Section;
1414
use Filament\Schemas\Components\Utilities\Get;
15-
use Filament\Support\Colors\Color;
1615

1716
abstract class Base implements FieldContract
1817
{
@@ -71,21 +70,21 @@ public function getForm(): array
7170
$set('config.required_if_values', []);
7271
$set('config.required_unless_values', []);
7372
}),
74-
73+
7574
Select::make('config.required_if_field')
7675
->label(__('Target Field'))
7776
->options(function (Get $get) {
7877
$currentFieldId = $get('id');
7978
$modelKey = $get('model_key');
80-
79+
8180
return Field::where('model_key', $modelKey)
8281
->where('id', '!=', $currentFieldId)
8382
->pluck('name', 'slug')
8483
->toArray();
8584
})
8685
->searchable()
8786
->visible(fn (Get $get) => filled($get('config.required_if_type'))),
88-
87+
8988
Repeater::make('config.required_if_values')
9089
->label(__('Required Values'))
9190
->schema([
@@ -96,7 +95,7 @@ public function getForm(): array
9695
->addActionLabel(__('Add Value'))
9796
->visible(fn (Get $get) => in_array($get('config.required_if_type'), ['required_if', 'required_unless']))
9897
->columns(1),
99-
98+
10099
Repeater::make('config.required_unless_values')
101100
->label(__('Required Unless Values'))
102101
->schema([
@@ -155,21 +154,23 @@ public static function applyDefaultSettings($input, ?Field $field = null)
155154
->pluck('value')
156155
->filter()
157156
->toArray();
158-
159-
if (!empty($values)) {
157+
158+
if (! empty($values)) {
160159
$input->requiredIf($requiredIfField, ...$values);
161160
}
161+
162162
break;
163-
163+
164164
case 'required_unless':
165165
$values = collect($field->config['required_unless_values'] ?? [])
166166
->pluck('value')
167167
->filter()
168168
->toArray();
169-
170-
if (!empty($values)) {
169+
170+
if (! empty($values)) {
171171
$input->requiredUnless($requiredIfField, ...$values);
172172
}
173+
173174
break;
174175
}
175176
}

0 commit comments

Comments
 (0)