Configuration

Configuration options for logging behavior is in config/logging.php.
By default, Laravel will use the stack channel when logging messages, which aggregates multiple log channels into a single channel.

Maintenance Mode

Temporarily disable application (503 status code)

php artisan down

#Disable maintenance mode

php artisan up

#Bypass Maintenance Mode

php artisan down --secret="1630542a-246b-4b66-afa1-dd72a4c43515"

Visit your application URL https://example.com/1630542a-246b-4b66-afa1-dd72a4c43515 to set a cookie and bypass the maintenance screen

Debug Mode

Turn on (local dev):

// .env file
APP_ENV=local
APP_DEBUG=true
// ...

Turn off (production):

// .env file
APP_ENV=production
APP_DEBUG=false
// ...

.env

Retrieve values from .env file

env('APP\_DEBUG');
// with default value
env('APP\_DEBUG', false);

Determine current environment

use Illuminate\Support\Facades\App;
$environment = App::environment();

Accessing configuration values using "dot" syntax

// config/app.php --> ['timezone' => '']
$value = config('app.timezone');
// Retrieve a default value if the configuration value does not exist...
$value = config('app.timezone', 'Asia/Seoul');

Set configuration values at runtime:

config(['app.timezone' => 'America/Chicago']);
Comments