LoginSignup
14
12

More than 3 years have passed since last update.

【Laravel】Laravel初期設定

Last updated at Posted at 2020-04-29

①タイムゾーン変更

タイムゾーンを下記の通り変更する。

config/app.php
// 変更前
'timezone' => 'UTC',

// 変更後
'timezone' => 'Asia/Tokyo',

②Locale変更

Localeを下記の通り変更する。

config/app.php
// 変更前
'locale' => 'en',

// 変更後
'locale' => 'ja',

③DB文字コード変更

DB文字コード変更を下記の通り変更する。

config/database.php
// 変更前
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',

// 変更後
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',

④デバッグバーのインストール

ディレクトリ移動

公文)
$ cd /Applications/MAMP/htdocs/プロジェクト名
例)
$ cd /Applications/MAMP/htdocs/laravel_test

デバッグバーのインストール

$ composer require barryvdh/laravel-debugbar

サーバ起動

$ php artisan serve

起動確認
http://127.0.0.1:8000

⑤デバッグバー非表示設定

デバッグバー表示設定を下記の通り変更する。

.env
// 変更前
APP_DEBUG=true

// 変更後
APP_DEBUG=false

Laravel cacheクリア

$ php artisan cache:clear

Laravel configクリア

$ php artisan config:clear
14
12
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
12