@@ -122,7 +122,6 @@ public static function getSaveAction(): Action
122122 ->keyBindings (['command+s ' , 'ctrl+s ' ])
123123 ->color ('success ' )
124124 ->action (function ($ livewire ): void {
125- // static::handleTranslationBeforeSave($livewire);
126125 $ livewire instanceof CreateRecord ? $ livewire ->create () : $ livewire ->save ();
127126 })
128127 ->visible (fn ($ livewire ): bool => $ livewire instanceof CreateRecord || $ livewire instanceof EditRecord);
@@ -203,33 +202,4 @@ public static function getRestoreAction(): Action
203202 ->visible (fn ($ livewire , $ record ): bool => $ record && $ record ->trashed ());
204203 }
205204
206- // protected static function handleTranslationBeforeSave($livewire): void
207- // {
208- // $locale = $livewire->lang;
209- // if (!$locale || !$livewire->record) {
210- // return;
211- // }
212-
213- // // Get or create translation
214- // $translation = $livewire->record->translateOrNew($locale);
215- // // Copy all translatable attributes to translation
216- // foreach ($livewire->record->translatedAttributes as $attr) {
217- // if (isset($livewire->data[$attr])) {
218- // $translation->$attr = $livewire->data[$attr];
219- // }
220- // }
221-
222- // // Set author if it's a new translation
223- // if (!$translation->exists) {
224- // $translation->author_id = auth()->id();
225- // }
226-
227- // // Save the translation
228- // $livewire->record->translations()->save($translation);
229-
230- // // Handle status changes if needed
231- // if ($livewire->record->isDirty('status')) {
232- // $livewire->record->handleSchedulingDates();
233- // }
234- // }
235205}
0 commit comments