trans('global.app_name'), 'date_format' => $this->allowedDateFormats()[0] ); } public function get($key, $defaultIfUnset = true) { $config = Configuration::where('key', $key)->first(); return (is_null($config) ? $this->defaults()[$key] : $config->value); } public function getAll() { $results = array(); foreach (Configuration::all() as $config) { $results[$config->key] = $config->value; } return $results; } public function getOrCreateModel($key) { $config = Configuration::where('key', $key)->first(); if (is_null($config) || $config === false) { $config = new Configuration(); $config->key = $key; $config->value = ''; $config->save(); } return $config; } }