src/Generator/ModelWriter.php
protected function makeTranslatedDataFromModelData(array $model)
    {
        // translated model is sluggable if model is, but on translated property or column
        $sluggable = ($model['sluggable'] && array_get($model, 'sluggable_setup.translated'));

        return [
            'module'                => $model['module'],
            'name'                  => $model['name'] . config('pxlcms.generator.models.translation_model_postfix'),
            'table'                 => ! empty($model['table'])
                ? $model['table'] . snake_case(config('pxlcms.tables.translation_postfix', '_ml'))
                : null,
            'cached'                => $model['cached'],
            'is_translated'         => false,
            'is_translation'        => true,    // only true if it is a Translation model itself
            'is_listified'          => false,
            'order_by'              => [],
            // attributes
            'normal_fillable'       => $model['translated_attributes'],
            'translated_fillable'   => [],
            'hidden'                => [],
            'casts'                 => [],
            'dates'                 => [],
            'defaults'              => [],
            'normal_attributes'     => [],
            'translated_attributes' => [],
            'timestamps'            => null,
            // categories
            'categories_module'     => null,
            // relations
            'relations_config'      => [],
            'relationships'         => [
                'normal'   => [],
                'reverse'  => [],
                'image'    => [],
                'file'     => [],
                'checkbox' => [],
            ],
            // special
            'sluggable'       => $sluggable,
            'sluggable_setup' => $sluggable ? $model['sluggable_setup'] : [],
            'scope_active'    => false,
            'scope_position'  => false,
        ];
    }
protected function makeTranslatedDataFromModelData(array $model)
    {
        // translated model is sluggable if model is, but on translated property or column
        $sluggable = ($model['sluggable'] && array_get($model, 'sluggable_setup.translated'));

        return [
            'module'                => $model['module'],
            'name'                  => $model['name'] . config('pxlcms.generator.models.translation_model_postfix'),
            'table'                 => ! empty($model['table'])
                ? $model['table'] . snake_case(config('pxlcms.tables.translation_postfix', '_ml'))
                : null,
            'cached'                => $model['cached'],
            'is_translated'         => false,
            'is_translation'        => true,    // only true if it is a Translation model itself
            'is_listified'          => false,
            'order_by'              => [],
            // attributes
            'normal_fillable'       => $model['translated_attributes'],
            'translated_fillable'   => [],
            'hidden'                => [],
            'casts'                 => [],
            'dates'                 => [],
            'defaults'              => [],
            'normal_attributes'     => [],
            'translated_attributes' => [],
            'timestamps'            => null,
            // categories
            'categories_module'     => null,
            // relations
            'relations_config'      => [],
            'relationships'         => [
                'normal'   => [],
                'reverse'  => [],
                'image'    => [],
                'file'     => [],
                'checkbox' => [],
            ],
            // special
            'sluggable'       => $sluggable,
            'sluggable_setup' => $sluggable ? $model['sluggable_setup'] : [],
            'scope_active'    => false,
            'scope_position'  => false,
        ];
    }
protected function makeTranslatedDataFromModelData ( array $ model ) { // translated model is sluggable if model is, but on translated property or column $ sluggable = ( $ model [ 'sluggable' ] && array_get ( $ model , 'sluggable_setup.translated' ) ) ; return [ 'module' => $ model [ 'module' ] , 'name' => $ model [ 'name' ] . config ( 'pxlcms.generator.models.translation_model_postfix' ) , 'table' => ! empty ( $ model [ 'table' ] ) ? $ model [ 'table' ] . snake_case ( config ( 'pxlcms.tables.translation_postfix' , '_ml' ) ) : null , 'cached' => $ model [ 'cached' ] , 'is_translated' => false , 'is_translation' => true , // only true if it is a Translation model itself 'is_listified' => false , 'order_by' => [ ] , // attributes 'normal_fillable' => $ model [ 'translated_attributes' ] , 'translated_fillable' => [ ] , 'hidden' => [ ] , 'casts' => [ ] , 'dates' => [ ] , 'defaults' => [ ] , 'normal_attributes' => [ ] , 'translated_attributes' => [ ] , 'timestamps' => null , // categories 'categories_module' => null , // relations 'relations_config' => [ ] , 'relationships' => [ 'normal' => [ ] , 'reverse' => [ ] , 'image' => [ ] , 'file' => [ ] , 'checkbox' => [ ] , ] , // special 'sluggable' => $ sluggable , 'sluggable_setup' => $ sluggable ? $ model [ 'sluggable_setup' ] : [ ] , 'scope_active' => false , 'scope_position' => false , ] ; }
Make model data array for translation model

@param array $model
@return array
Make model data array for translation model