database/migrations/2014_11_16_114113_create_options.php
private function seedOptions()
    {
        // gzero config options
        $options = [
            'general' => [
                'site_name'          => [],
                'site_desc'          => [],
                'default_page_size'  => [],
                'cookies_policy_url' => [],
            ],
            'seo'     => [
                'desc_length'         => [],
                'google_analytics_id' => [],
            ]
        ];

        // Propagate Lang options based on gzero config
        foreach ($options as $categoryKey => $category) {
            foreach ($options[$categoryKey] as $key => $option) {
                foreach (Language::all()->toArray() as $lang) {
                    if ($categoryKey != 'general') {
                        $options[$categoryKey][$key][$lang['code']] = config('gzero.' . $categoryKey . '.' . $key);
                    } else {
                        $value = $this->getDefaultValueForGeneral($key);

                        $options[$categoryKey][$key][$lang['code']] = $value;
                    }
                }
            }
        }

        // Seed options
        foreach ($options as $category => $option) {
            OptionCategory::create(['key' => $category]);
            foreach ($option as $key => $value) {
                OptionCategory::find($category)->options()->create(
                    ['key' => $key, 'value' => $value]
                );
            }
        }
    }
private function seedOptions()
    {
        // gzero config options
        $options = [
            'general' => [
                'site_name'          => [],
                'site_desc'          => [],
                'default_page_size'  => [],
                'cookies_policy_url' => [],
            ],
            'seo'     => [
                'desc_length'         => [],
                'google_analytics_id' => [],
            ]
        ];

        // Propagate Lang options based on gzero config
        foreach ($options as $categoryKey => $category) {
            foreach ($options[$categoryKey] as $key => $option) {
                foreach (Language::all()->toArray() as $lang) {
                    if ($categoryKey != 'general') {
                        $options[$categoryKey][$key][$lang['code']] = config('gzero.' . $categoryKey . '.' . $key);
                    } else {
                        $value = $this->getDefaultValueForGeneral($key);

                        $options[$categoryKey][$key][$lang['code']] = $value;
                    }
                }
            }
        }

        // Seed options
        foreach ($options as $category => $option) {
            OptionCategory::create(['key' => $category]);
            foreach ($option as $key => $value) {
                OptionCategory::find($category)->options()->create(
                    ['key' => $key, 'value' => $value]
                );
            }
        }
    }
private function seedOptions ( ) { // gzero config options $ options = [ 'general' => [ 'site_name' => [ ] , 'site_desc' => [ ] , 'default_page_size' => [ ] , 'cookies_policy_url' => [ ] , ] , 'seo' => [ 'desc_length' => [ ] , 'google_analytics_id' => [ ] , ] ] ; // Propagate Lang options based on gzero config foreach ( $ options as $ categoryKey => $ category ) { foreach ( $ options [ $ categoryKey ] as $ key => $ option ) { foreach ( Language :: all ( ) -> toArray ( ) as $ lang ) { if ( $ categoryKey != 'general' ) { $ options [ $ categoryKey ] [ $ key ] [ $ lang [ 'code' ] ] = config ( 'gzero.' . $ categoryKey . '.' . $ key ) ; } else { $ value = $ this -> getDefaultValueForGeneral ( $ key ) ; $ options [ $ categoryKey ] [ $ key ] [ $ lang [ 'code' ] ] = $ value ; } } } } // Seed options foreach ( $ options as $ category => $ option ) { OptionCategory :: create ( [ 'key' => $ category ] ) ; foreach ( $ option as $ key => $ value ) { OptionCategory :: find ( $ category ) -> options ( ) -> create ( [ 'key' => $ key , 'value' => $ value ] ) ; } } }
Seed options from gzero config to 'main' category

@return void
Seed options from gzero config to main category