Readouble

Laravel master インストール

インストールInstallation

サーバ要件Server Requirements

Laravelフレームワークを動作させるには多少のシステム要件があります。もちろん、Laravel Homestead仮想マシンでは、要求が全て満たされています。ですから、Laravelのローカル開発環境としてHomesteadを活用されることを強くおすすめします。The Laravel framework has a few system requirements. Of course, all of these requirements are satisfied by the Laravel Homestead[/docs/{{version}}/homestead] virtual machine, so it's highly recommended that you use Homestead as your local Laravel development environment.

しかし、Homesteadを使用しない場合は、以下の要件を満たす必要があります。However, if you are not using Homestead, you will need to make sure your server meets the following requirements:

- PHP >= 5.6.4 - OpenSSL PHP拡張 - PDO PHP拡張 - Mbstring PHP拡張 - Tokenizer PHP拡張 - XML PHP拡張

LaravelのインストールInstalling Laravel

LaravelはComposerを依存パッケージの管理に使用しています。ですから、Laravelを始める前に、自分の開発機にComposerを確実にインストールしておいてください。Laravel utilizes Composer[http://getcomposer.org] to manage its dependencies. So, before using Laravel, make sure you have Composer installed on your machine.

LaravelインストーラーVia Laravel Installer

最初にComposerを使用し、Laravelインストーラーをダウンロードします。First, download the Laravel installer using Composer:

composer global require "laravel/installer"

システムのどこからでもlaravelが実行できるように、実行ファイルパスの$PATHで、$HOME/.composer/vendor/binディレクトリ(OSにより場所は異なります)を確実に指定してください。Make sure to place the $HOME/.composer/vendor/bin directory (or the equivalent directory for your OS) in your $PATH so the laravel executable can be located by your system.

インストールし終えたら、laravel newコマンドにより、指定したディレクトリに真新しいLaravelプロジェクトを作成できます。例えば、laravel new blogを実行すると、blogという名前のディレクトへ、必要とするパッケージが全部揃った、真新しいLaravelがインストールされます。Once installed, the laravel new command will create a fresh Laravel installation in the directory you specify. For instance, laravel new blog will create a directory named blog containing a fresh Laravel installation with all of Laravel's dependencies already installed:

laravel new blog

Composer Create-ProjectVia Composer Create-Project

ターミナルでComposerのcreate-projectコマンドを実行し、Laravelをインストールする方法もあります。Alternatively, you may also install Laravel by issuing the Composer create-project command in your terminal:

composer create-project --prefer-dist laravel/laravel blog

ローカル開発サーバLocal Development Server

PHPがローカルにインストール済みで、PHPの組込み開発サーバをアプリケーションサーバとして使いたい場合は、serve Artisanコマンドを使用します。このコマンドは、開発サーバをhttp://localhost:8000として起動します。If you have PHP installed locally and you would like to use PHP's built-in development server to serve your application, you may use the serve Artisan command. This command will start a development server at http://localhost:8000:

php artisan serve

もちろん、より堅牢なローカル開発の選択肢として、HomesteadValetも利用できます。Of course, more robust local development options are available via Homestead[/docs/{{version}}/homestead] and Valet[/docs/{{version}}/valet].

設定Configuration

PublicディレクトリPublic Directory

Laravelをインストールできたら、Webサーバのドキュメント/Webルートがpublicディレクトリになるように設定してください。このディレクトリのindex.phpは、アプリケーションへ送信された、全HTTPリクエストを始めに処理するフロントコントローラとして動作します。After installing Laravel, you should configure your web server's document / web root to be the public directory. The index.php in this directory serves as the front controller for all HTTP requests entering your application.

設定 FilesConfiguration Files

フレームワークで使用する設定ファイルは全てconfigディレクトリ下に設置しています。それぞれのオプションにコメントがついていますので、使用可能なオプションを理解するため、ファイル全体に目を通しておくのが良いでしょう。All of the configuration files for the Laravel framework are stored in the config directory. Each option is documented, so feel free to look through the files and get familiar with the options available to you.

ディレクトリパーミッションDirectory Permissions

Laravelをインストールした後に、多少のパーミッションの設定が必要です。storage下とbootstrap/cacheディレクトリーをWebサーバーから書き込み可能にしてください。設定しないとLaravelは正しく実行されません。Homestead仮想マシンを使用する場合は、あらかじめ設定されています。After installing Laravel, you may need to configure some permissions. Directories within the storage and the bootstrap/cache directories should be writable by your web server or Laravel will not run. If you are using the Homestead[/docs/{{version}}/homestead] virtual machine, these permissions should already be set.

アプリケーションキーApplication Key

次にインストール後に行うべきなのは、アプリケーションキーにランダムな文字列を設定することです。ComposerかLaravelインストーラを使ってインストールしていれば、php artisan key:generateコマンドにより、既に設定されています。The next thing you should do after installing Laravel is set your application key to a random string. If you installed Laravel via Composer or the Laravel installer, this key has already been set for you by the php artisan key:generate command.

通常、この文字列は32文字にすべきです。キーは.env環境ファイルに設定されます。もし、.env.exampleファイルをまだ.envにリネームしていなければ、今すぐ行ってください。アプリケーションキーが設定されていなければ、ユーザーセッションや他の暗号化済みデーターは安全ではありません!Typically, this string should be 32 characters long. The key can be set in the .env environment file. If you have not renamed the .env.example file to .env, you should do that now. If the application key is not set, your user sessions and other encrypted data will not be secure!

その他の設定Additional Configuration

Laravelのその他の設定は、最初に指定する必要がありません。すぐに開発を開始しても大丈夫です! しかし、config/app.phpファイルと、その中の記述を確認しておいたほうが良いでしょう。アプリケーションに合わせ変更したい、timezonelocalのような多くのオプションが含まれています。Laravel needs almost no other configuration out of the box. You are free to get started developing! However, you may wish to review the config/app.php file and its documentation. It contains several options such as timezone and locale that you may wish to change according to your application.

以下のようなLaravelのコンポーネントについても、設定しておいたほうが良いでしょう。You may also want to configure a few additional components of Laravel, such as:

- [キャッシュ](/docs/{{version}}/cache#configuration) - [データベース](/docs/{{version}}/database#configuration) - [セッション](/docs/{{version}}/session#configuration)

Laravelをインストールし終えたら、ローカル環境の設定も済ませてください。Once Laravel is installed, you should also configure your local environment[/docs/{{version}}/configuration#environment-configuration].

章選択

開発環境
ビューとテンプレート
公式パッケージ

設定

明暗テーマ
light_mode
dark_mode
brightness_auto システム設定に合わせる
テーマ選択
photo_size_select_actual デフォルト
photo_size_select_actual モノクローム(白黒)
photo_size_select_actual Solarized風
photo_size_select_actual GitHub風(青ベース)
photo_size_select_actual Viva(黄緑ベース)
photo_size_select_actual Happy(紫ベース)
photo_size_select_actual Mint(緑ベース)
コードハイライトテーマ選択

明暗テーマごとに、コードハイライトのテーマを指定できます。

テーマ配色確認
スクリーン表示幅
640px
80%
90%
100%

768px以上の幅があるときのドキュメント部分表示幅です。

インデント
無し
1rem
2rem
3rem
原文確認
原文を全行表示
原文を一行ずつ表示
使用しない

※ 段落末のEボタンへカーソルオンで原文をPopupします。

Diff表示形式
色分けのみで区別
行頭の±で区別
削除線と追記で区別

※ [tl!…]形式の挿入削除行の表示形式です。

Pagination和文
ペジネーション
ペギネーション
ページネーション
ページ付け
Scaffold和文
スカフォールド
スキャフォールド
型枠生成
本文フォント

総称名以外はCSSと同様に、"〜"でエスケープしてください。

コードフォント

総称名以外はCSSと同様に、"〜"でエスケープしてください。

保存内容リセット

localStrageに保存してある設定項目をすべて削除し、デフォルト状態へ戻します。

ヘッダー項目移動

キーボード操作