22
33namespace Vormkracht10 \FilamentFields \Filament \RelationManagers ;
44
5- use Filament \Tables ;
6- use Filament \Forms \Get ;
7- use Filament \Forms \Set ;
8- use Livewire \Component ;
9- use Filament \Forms \Form ;
10- use Filament \Tables \Table ;
11- use Illuminate \Support \Str ;
125use Filament \Forms \Components \Grid ;
13- use Filament \Forms \Components \Select ;
146use Filament \Forms \Components \Section ;
15- use Illuminate \ Database \ Eloquent \ Model ;
7+ use Filament \ Forms \ Components \ Select ;
168use Filament \Forms \Components \TextInput ;
17- use Vormkracht10 \FilamentFields \Models \Field ;
9+ use Filament \Forms \Form ;
10+ use Filament \Forms \Get ;
11+ use Filament \Forms \Set ;
1812use Filament \Resources \RelationManagers \RelationManager ;
13+ use Filament \Tables ;
14+ use Filament \Tables \Table ;
15+ use Illuminate \Database \Eloquent \Model ;
16+ use Illuminate \Support \Str ;
17+ use Livewire \Component ;
1918use Vormkracht10 \Fields \Facades \Fields ;
20- use Vormkracht10 \FilamentFields \Concerns \HasFieldTypeResolver ;
2119use Vormkracht10 \FilamentFields \Concerns \HasConfigurableFields ;
20+ use Vormkracht10 \FilamentFields \Concerns \HasFieldTypeResolver ;
21+ use Vormkracht10 \FilamentFields \Models \Field ;
2222
2323class FieldsRelationManager extends RelationManager
2424{
@@ -42,7 +42,7 @@ public function form(Form $form): Form
4242 ->required ()
4343 ->placeholder (__ ('Name ' ))
4444 ->live (debounce: 250 )
45- ->afterStateUpdated (fn (Set $ set , ?string $ state ) => $ set ('slug ' , Str::slug ($ state ))),
45+ ->afterStateUpdated (fn (Set $ set , ?string $ state ) => $ set ('slug ' , Str::slug ($ state ))),
4646
4747 TextInput::make ('slug ' )
4848 ->readonly (),
@@ -74,10 +74,10 @@ function () {
7474 ]),
7575 Section::make ('Configuration ' )
7676 ->columns (3 )
77- ->schema (fn (Get $ get ) => $ this ->getFieldTypeFormSchema (
77+ ->schema (fn (Get $ get ) => $ this ->getFieldTypeFormSchema (
7878 $ get ('field_type ' )
7979 ))
80- ->visible (fn (Get $ get ) => filled ($ get ('field_type ' ))),
80+ ->visible (fn (Get $ get ) => filled ($ get ('field_type ' ))),
8181 ]),
8282 ]);
8383 }
@@ -161,7 +161,7 @@ public function table(Table $table): Table
161161 'model_key ' => $ this ->ownerRecord ->slug ,
162162 ];
163163 })
164- ->mutateFormDataUsing (fn (array $ data , Model $ record ): array => $ this ->transferValuesOnSlugChange ($ data , $ record ))
164+ ->mutateFormDataUsing (fn (array $ data , Model $ record ): array => $ this ->transferValuesOnSlugChange ($ data , $ record ))
165165 ->after (function (Component $ livewire ) {
166166 $ livewire ->dispatch ('refreshFields ' );
167167 }),
@@ -224,4 +224,4 @@ private function transferValuesOnSlugChange(array $data, Model $record): array
224224
225225 return $ data ;
226226 }
227- }
227+ }
0 commit comments