Vsch\TranslationManager\Manager::config PHP Method

config() public method

public config ( $key = null, $default = null )
    public function config($key = null, $default = null)
    {
        // Version 5.1
        if (!$this->config) {
            $this->config = $this->app['config'][$this->package];
        }
        // Version 4.2
        //if (!$this->config) $this->config = $this->app['config'][$this->package.'::config'];
        if ($key === null) {
            return $this->config;
        }
        if (array_key_exists($key, $this->config)) {
            return $this->config[$key];
        }
        return $default;
    }

Usage Example

 public function postYandexKey()
 {
     return \Response::json(array('status' => 'ok', 'yandex_key' => $this->manager->config('yandex_translator_key', null)));
 }