src/app/Logic/Config.php
public function add(string $category_key, array $configuration)
    {
        $category = ConfigCategory::where('key', $category_key)->first();
        if (!$category) {
            throw new \Exception("Category with name ($category_key) not found");
        }
        foreach ($configuration as $config) {
            $this->checkConfiguration($config);
            $config = array_merge($config, ['config_category_id' => $category->id]);
            Model::create($config);
        }
    }
public function add(string $category_key, array $configuration)
    {
        $category = ConfigCategory::where('key', $category_key)->first();
        if (!$category) {
            throw new \Exception("Category with name ($category_key) not found");
        }
        foreach ($configuration as $config) {
            $this->checkConfiguration($config);
            $config = array_merge($config, ['config_category_id' => $category->id]);
            Model::create($config);
        }
    }
public function add ( string $ category_key , array $ configuration ) { $ category = ConfigCategory :: where ( 'key' , $ category_key ) -> first ( ) ; if ( ! $ category ) { throw new \ Exception ( "Category with name ($category_key) not found" ) ; } foreach ( $ configuration as $ config ) { $ this -> checkConfiguration ( $ config ) ; $ config = array_merge ( $ config , [ 'config_category_id' => $ category -> id ] ) ; Model :: create ( $ config ) ; } }
Function for add configuration to project

@param string $category_key
@param array $configuration
@return void
Function for add configuration to project