Skip to content

Commit 73090ef

Browse files
committed
Merge branch 'main' of github.com:backstagephp/fields
2 parents 8babbf7 + ec7253d commit 73090ef

26 files changed

+85
-85
lines changed

database/factories/FieldFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace Backstage\Fields\Database\Factories;
44

5-
use Illuminate\Database\Eloquent\Factories\Factory;
65
use Backstage\Fields\Models\Field;
6+
use Illuminate\Database\Eloquent\Factories\Factory;
77

88
class FieldFactory extends Factory
99
{

src/Concerns/CanMapDynamicFields.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace Backstage\Fields\Concerns;
44

5-
use Illuminate\Support\Collection;
6-
use Livewire\Attributes\On;
75
use Backstage\Fields\Contracts\FieldInspector;
86
use Backstage\Fields\Enums\Field;
97
use Backstage\Fields\Fields;
@@ -21,6 +19,8 @@
2119
use Backstage\Fields\Fields\Textarea;
2220
use Backstage\Fields\Fields\Toggle;
2321
use Backstage\Fields\Models\Field as Model;
22+
use Illuminate\Support\Collection;
23+
use Livewire\Attributes\On;
2424

2525
trait CanMapDynamicFields
2626
{
@@ -110,7 +110,7 @@ private function resolveFormFields(mixed $record = null): array
110110
$customFields = $this->resolveCustomFields();
111111

112112
return $record->fields
113-
->map(fn($field) => $this->resolveFieldInput($field, $customFields, $record))
113+
->map(fn ($field) => $this->resolveFieldInput($field, $customFields, $record))
114114
->filter()
115115
->values()
116116
->all();
@@ -119,7 +119,7 @@ private function resolveFormFields(mixed $record = null): array
119119
private function resolveCustomFields(): Collection
120120
{
121121
return collect(Fields::getFields())
122-
->map(fn($fieldClass) => new $fieldClass);
122+
->map(fn ($fieldClass) => new $fieldClass);
123123
}
124124

125125
private function resolveFieldInput(Model $field, Collection $customFields, mixed $record = null): ?object

src/Concerns/HasConfigurableFields.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace Backstage\Fields\Concerns;
44

5-
use Illuminate\Support\Str;
65
use Backstage\Fields\Facades\Fields;
6+
use Illuminate\Support\Str;
77

88
trait HasConfigurableFields
99
{

src/Concerns/HasEnumNames.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ abstract public static function cases(): array;
88

99
public static function names(): array
1010
{
11-
return array_map(fn($enum) => $enum->name, static::cases());
11+
return array_map(fn ($enum) => $enum->name, static::cases());
1212
}
1313
}

src/Concerns/HasEnumValues.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ abstract public static function cases(): array;
88

99
public static function values(): array
1010
{
11-
return array_map(fn($enum) => $enum->value, static::cases());
11+
return array_map(fn ($enum) => $enum->value, static::cases());
1212
}
1313
}

src/Concerns/HasFieldTypeResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace Backstage\Fields\Concerns;
44

5-
use Exception;
6-
use Illuminate\Support\Str;
75
use Backstage\Fields\Enums\Field;
86
use Backstage\Fields\Facades\Fields;
7+
use Exception;
8+
use Illuminate\Support\Str;
99

1010
trait HasFieldTypeResolver
1111
{

src/Concerns/HasFields.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace Backstage\Fields\Concerns;
44

5-
use Illuminate\Database\Eloquent\Relations\MorphMany;
65
use Backstage\Fields\Models\Field;
6+
use Illuminate\Database\Eloquent\Relations\MorphMany;
77

88
trait HasFields
99
{

src/Concerns/HasOptions.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ public function optionFormFields(): Fieldset
105105
Forms\Components\KeyValue::make('config.options')
106106
->label(__('Options'))
107107
->columnSpanFull()
108-
->visible(fn(Forms\Get $get): bool => $get('config.optionType') == 'array')
109-
->required(fn(Forms\Get $get): bool => $get('config.optionType') == 'array'),
108+
->visible(fn (Forms\Get $get): bool => $get('config.optionType') == 'array')
109+
->required(fn (Forms\Get $get): bool => $get('config.optionType') == 'array'),
110110
// Relationship options
111111
Repeater::make('config.relations')
112112
->label(__('Relations'))
@@ -165,19 +165,19 @@ public function optionFormFields(): Fieldset
165165
->toArray();
166166
})
167167
->noSearchResultsMessage(__('No types found'))
168-
->required(fn(Forms\Get $get): bool => $get('config.optionType') == 'relationship'),
168+
->required(fn (Forms\Get $get): bool => $get('config.optionType') == 'relationship'),
169169
Forms\Components\Hidden::make('relationKey')
170170
->default('ulid')
171171
->label(__('Key'))
172-
->required(fn(Forms\Get $get): bool => $get('config.optionType') == 'relationship'),
172+
->required(fn (Forms\Get $get): bool => $get('config.optionType') == 'relationship'),
173173
Forms\Components\Repeater::make('relationValue_filters')
174174
->label(__('Filters'))
175-
->visible(fn(Forms\Get $get): bool => ! empty($get('resource')))
175+
->visible(fn (Forms\Get $get): bool => ! empty($get('resource')))
176176
->schema([
177177
Forms\Components\Grid::make(3)
178178
->schema([
179179
Forms\Components\Select::make('column')
180-
->options(fn(\Filament\Forms\Get $get) => $get('../../relationValue_options') ?? [
180+
->options(fn (\Filament\Forms\Get $get) => $get('../../relationValue_options') ?? [
181181
'slug' => __('Slug'),
182182
'name' => __('Name'),
183183
])
@@ -232,7 +232,7 @@ public function optionFormFields(): Fieldset
232232
->columnSpanFull(),
233233
]),
234234
])
235-
->visible(fn(Forms\Get $get): bool => $get('config.optionType') == 'relationship')
235+
->visible(fn (Forms\Get $get): bool => $get('config.optionType') == 'relationship')
236236
->columnSpanFull(),
237237
]),
238238
]);

src/Fields/Base.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace Backstage\Fields;
44

5-
use Filament\Forms;
6-
use Filament\Support\Colors\Color;
75
use Backstage\Fields\Contracts\FieldContract;
86
use Backstage\Fields\Models\Field;
7+
use Filament\Forms;
8+
use Filament\Support\Colors\Color;
99

1010
abstract class Base implements FieldContract
1111
{

src/Fields/Checkbox.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace Backstage\Fields;
44

5-
use Filament\Forms;
6-
use Filament\Forms\Components\Checkbox as Input;
75
use Backstage\Fields\Contracts\FieldContract;
86
use Backstage\Fields\Models\Field;
7+
use Filament\Forms;
8+
use Filament\Forms\Components\Checkbox as Input;
99

1010
class Checkbox extends Base implements FieldContract
1111
{

0 commit comments

Comments
 (0)