Skip to content

Laravel initial settings

ucan-lab edited this page Mar 25, 2022 · 5 revisions

Edit to config/app.php

Timezone & Language

[
    'timezone' => 'Asia/Tokyo',
    'locale' => 'ja',
    'fallback_locale' => 'ja',
    'faker_locale' => 'ja_JP',
],

Edit to config/database.php

Charset & Collation

[
    'connections' => [
        'mysql' => [
            'charset' => 'utf8mb4',
            'collation' => 'utf8mb4_ja_0900_as_cs_ks',
        ],
    ],
],

Google App Engine

https://cloud.google.com/community/tutorials/run-laravel-on-appengine-standard

Edit to bootstrap/app.php

// Add after $app instance creation

/*
|--------------------------------------------------------------------------
| Set Storage Path
|--------------------------------------------------------------------------
|
| This script allows you to override the default storage location used by
| the  application.  You may set the APP_STORAGE environment variable
| in your .env file,  if not set the default location will be used
|
*/
$app->useStoragePath(env('APP_STORAGE', base_path() . '/storage'));

Edit to .env.example, .env

# Edit
LOG_CHANNEL=stderr
SESSION_DRIVER=cookie

# Add
APP_SERVICES_CACHE=/tmp/services.php
APP_PACKAGES_CACHE=/tmp/packages.php
APP_CONFIG_CACHE=/tmp/config.php
APP_ROUTES_CACHE=/tmp/routes.php
APP_EVENTS_CACHE=/tmp/events.php
APP_STORAGE=/tmp
VIEW_COMPILED_PATH=/tmp