config() public method

public config ( string $key, mixed $default = null ) : mixed
$key string
$default mixed
return mixed
Example #1
0
 /**
  * @param Request $request
  * @return \Psr\Http\Message\ResponseInterface
  */
 public function handle(Request $request)
 {
     $input = $request->getParsedBody();
     if (array_get($input, 'databasePassword') !== $this->app->config('database.password')) {
         return new HtmlResponse('Incorrect database password.', 500);
     }
     $body = fopen('php://temp', 'wb+');
     $input = new StringInput('');
     $output = new StreamOutput($body);
     try {
         $this->command->run($input, $output);
     } catch (Exception $e) {
         return new HtmlResponse($e->getMessage(), 500);
     }
     return new Response($body, 200);
 }
 /**
  * Set up the locale compiler for the given locale.
  *
  * @param string $locale
  * @return LocaleJsCompiler
  */
 protected function getLocaleCompiler($locale)
 {
     $compiler = new LocaleJsCompiler($this->getAssetDirectory(), "{$this->clientName}-{$locale}.js", $this->app->config('debug'), $this->cache);
     foreach ($this->locales->getJsFiles($locale) as $file) {
         $compiler->addFile($file);
     }
     return $compiler;
 }
Example #3
0
 /**
  * Get the user's locale, falling back to the forum's default if they
  * haven't set one.
  *
  * @param string $value
  * @return string
  */
 public function getLocaleAttribute($value)
 {
     return $value ?: Application::config('locale', 'en');
 }
Example #4
0
 protected function shouldWatch()
 {
     return $this->app->config('debug');
 }