app/Console/Commands/Support/Traits/TranslatableResolver.php
/**
     * This method is used  to remove duplicate fields.
     * eg: 'name_it', 'name_en', 'name_ru' became 'name'.
     */
This method is used  to remove duplicate fields.
This method is used to remove duplicate fields .
private function flattenTranslatableFields(): void
    {
        $translatableFields = [];
        array_walk($this->fields, function ($value, $key) use (&$translatableFields) {
            if ($this->isTranslatable($key)) {
                $bits = explode('_', $key);
                $key = implode('_', array_slice($bits, 0, max(1, count($bits) - 1)));
            }
            $translatableFields[$key] = $value;
        });
        $this->fields = $translatableFields;
    }
private function flattenTranslatableFields ( ) : void { $ translatableFields = [ ] ; array_walk ( $ this -> fields , function ( $ value , $ key ) use ( & $ translatableFields ) { if ( $ this -> isTranslatable ( $ key ) ) { $ bits = explode ( '_' , $ key ) ; $ key = implode ( '_' , array_slice ( $ bits , 0 , max ( 1 , count ( $ bits ) - 1 ) ) ) ; } $ translatableFields [ $ key ] = $ value ; } ) ; $ this -> fields = $ translatableFields ; }
This method is used  to remove duplicate fields.
This method is used to remove duplicate fields .
/*
         * Flat dei translatable fields.
         * Merge e unique delle chiavi multiple traducibili dell'array.
         *
         * Array originale: ['name_it' => [], 'name_en' => [], 'name_ru' => [], 'name_de' => [], 'name_es' => [], 'name_fr' => [], 'description' => []]
         * Obbiettivo: ['name' => [], 'description' => []]
         */ // Aggiorna i fields con il nuovo array filtrato.