igaster\laravelTheme\Theme::config PHP Method

config() public method

Return the configuration value of $key for the current theme. Configuration values are stored per theme in themes.php config file.
public config ( string $key, mixed $defaultValue = null ) : mixed
$key string
$defaultValue mixed
return mixed
    public function config($key, $defaultValue = null)
    {
        //root theme not have configs
        if (array_key_exists($this->name, $confs = \Config::get("themes.themes"))) {
            if (array_key_exists($key, $conf = $confs[$this->name])) {
                return $conf[$key];
            }
        }
        if ($this->getParent()) {
            return $this->getParent()->config($key, $defaultValue);
        }
        return $defaultValue;
    }