44
55namespace Relaticle \Flowforge \Adapters ;
66
7+ use App \Models \Task ;
78use Filament \Forms \Form ;
89use Illuminate \Database \Eloquent \Model ;
910use Illuminate \Support \Collection ;
@@ -160,53 +161,4 @@ public function moveCardToColumn(Model $card, string|int $columnId): bool
160161
161162 return $ card ->save ();
162163 }
163-
164- /**
165- * Convert the adapter to a Livewire-compatible array.
166- *
167- * @return array<string, mixed>
168- */
169- public function toLivewire (): array
170- {
171- return [
172- 'config ' => [
173- 'columnField ' => $ this ->config ->getColumnField (),
174- 'columnValues ' => $ this ->config ->getColumnValues (),
175- 'columnColors ' => $ this ->config ->getColumnColors (),
176- 'titleField ' => $ this ->config ->getTitleField (),
177- 'descriptionField ' => $ this ->config ->getDescriptionField (),
178- 'cardAttributes ' => $ this ->config ->getCardAttributes (),
179- 'orderField ' => $ this ->config ->getOrderField (),
180- 'cardLabel ' => $ this ->config ->getCardLabel (),
181- 'pluralCardLabel ' => $ this ->config ->getPluralCardLabel (),
182- // Note: createFormCallback cannot be serialized and must be reattached
183- ],
184- ];
185- }
186-
187- /**
188- * Create a new adapter instance from a Livewire-compatible array.
189- *
190- * @param array<string, mixed> $value The Livewire-compatible array
191- * @return static
192- */
193- public static function fromLivewire ($ value ): static
194- {
195- $ configData = $ value ['config ' ];
196-
197- $ config = new KanbanConfig (
198- columnField: $ configData ['columnField ' ],
199- columnValues: $ configData ['columnValues ' ],
200- columnColors: $ configData ['columnColors ' ],
201- titleField: $ configData ['titleField ' ],
202- descriptionField: $ configData ['descriptionField ' ],
203- cardAttributes: $ configData ['cardAttributes ' ],
204- orderField: $ configData ['orderField ' ],
205- cardLabel: $ configData ['cardLabel ' ],
206- pluralCardLabel: $ configData ['pluralCardLabel ' ],
207- // Note: createFormCallback is not serializable and must be reattached
208- );
209-
210- return new static ($ config );
211- }
212164}
0 commit comments