Readouble

Laravel 5.2 アップグレードガイド

5.1から5.2.0へのアップグレードUpgrading To 5.2.0 From 5.1

アップデートにかかる時間の見積もり:1時間以下Estimated Upgrade Time: Less Than 1 Hour

注意: フレームワークに影響が起きるだろう変更を包括的にリストしました。皆さんのアプリケーションの大半では、変更する必要がないものも多いでしょう。Note: We attempt to provide a very comprehensive listing of every possible breaking change made to the framework. However, many of these changes may not apply to your own application.

依存パッケージの更新Updating Dependencies

composer.jsonファイルの内容をlaravel/framework 5.2.*へ更新してください。Update your composer.json file to point to laravel/framework 5.2.*.

composer.jsonファイルのrequire-devセクションへ、"symfony/dom-crawler": "~3.0""symfony/css-selector": "~3.0"を追加してください。Add "symfony/dom-crawler": "~3.0" and "symfony/css-selector": "~3.0" to the require-dev section of your composer.json file.

認証Authentication

設定ファイルConfiguration File

https://github.com/laravel/laravel/blob/master/config/auth.phpへ、config/auth.php設定ファイルを更新してください。You should update your config/auth.php configuration file with the following: https://github.com/laravel/laravel/blob/master/config/auth.php[https://github.com/laravel/laravel/blob/master/config/auth.php]

新しいバージョンの内容に更新したら、古い設定ファイルの内容を元に、認証設定オプションを指定してください。Laravel5.1で使用できるEloquentベースの認証サービスが一般的には使われていますが、ほとんどの値はそのまま使用できるでしょう。Once you have updated the file with a fresh copy, set your authentication configuration options to their desired value based on your old configuration file. If you were using the typical, Eloquent based authentication services available in Laravel 5.1, most values should remain the same.

新しいauth.php設定ファイルのpasswords.users.email設定オプションへ特に注意を払ってください。デフォルトではLaravel5.2で変更になったらビューへのパスになっていますので、これがアプリケーションの実際のビューパスと一致しているか確認してください。新しい設定ファイルのデフォルト値が実際のビューと一致していない場合は、設定オプションをそれに合わせて変更してください。Take special note of the passwords.users.email configuration option in the new auth.php configuration file and verify that the view path matches the actual view path for your application, as the default path to this view was changed in Laravel 5.2. If the default value in the new configuration file does not match your existing view, update the configuration option.

契約Contracts

Illuminate\Contracts\Auth\Authenticatable契約を実装しているが、Authenticatableトレイトを使っていない場合は、新しいgetAuthIdentifierNameメソッドをその契約の実装に追加してください。通常、このメソッドはauthenticatableエンティティの「主キー」のカラム名を返します。たとえば、idです。If you are implementing the Illuminate\Contracts\Auth\Authenticatable contract but are not using the Authenticatable trait, you should add a new getAuthIdentifierName method to your contract implementation. Typically, this method will return the column name of the "primary key" of your authenticatable entity. For example: id.

このインターフェイスを自分で実装していない限り、アプリケーションに影響することはまずないでしょう。This is unlikely to affect your application unless you were manually implementing this interface.

カスタイムドライバCustom Drivers

ユーザを取得するカスタムメソッドを定義するAuth::extendメソッドを使っている場合、カスタムユーザプロバイダを定義するためのAuth::providerを使ってください。カスタムプロバイダを定義したら、新しいauth.php設定ファイルのproviders配列の中でそれを設定してください。If you are using the Auth::extend method to define a custom method of retrieving users, you should now use Auth::provider to define your custom user provider. Once you have defined the custom provider, you may configure it in the providers array of your new auth.php configuration file.

カスタム認証プロバイダについての詳細は、認証の完全なドキュメントで調べてください。For more information on custom authentication providers, consult the full authentication documentation[/docs/{{version}}/authentication].

リダイレクトRedirection

Illuminate\Foundation\Auth\AuthenticatesUsersからloginPath()メソッドが削除されました。そのため、AuthController$loginPath変数を設定しておく必要が無くなりました。デフォルトで、認証エラーがあった場合、トレイトがデフォルトで以前の場所へ毎回リダイレクトします。The loginPath() method has been removed from Illuminate\Foundation\Auth\AuthenticatesUsers, so placing a $loginPath variable in your AuthController is no longer required. By default, the trait will always redirect users back to their previous location on authentication errors.

認証Authorization

Illuminate\Auth\Access\UnauthorizedExceptionIlluminate\Auth\Access\AuthorizationExceptionへリネームされました。この例外を自分で補足していない限り、アプリケーションに影響は通常ありません。The Illuminate\Auth\Access\UnauthorizedException has been renamed to Illuminate\Auth\Access\AuthorizationException. This is unlikely to affect your application if you are not manually catching this exception.

コレクションCollections

EloquentベースコレクションEloquent Base Collections

Eloquentコレクションインスタンスのpluckkeyszipcollapseflattenflipメソッドは、ベースコレクション(Illuminate\Support\Collection)を返すようになりました。The Eloquent collection instance now returns a base Collection (Illuminate\Support\Collection) for the following methods: pluck, keys, zip, collapse, flatten, flip.

キーの保存Key Preservation

slicechunkreverseメソッドは、コレクションにキーを残すようになりました。これらのメソッドでキーを保存したくない場合は、Collectionインスタンスのvaluesメソッドを使ってください。The slice, chunk, and reverse methods now preserve keys on the collection. If you do not want these methods to preserve keys, use the values method on the Collection instance.

ComposerクラスComposer Class

Illuminate\Foundation\ComposerクラスはIlluminate\Support\Composerクラスへ移動しました。このクラスを直接使っていない限り、アプリケーションに通常影響しないでしょう。The Illuminate\Foundation\Composer class has been moved to Illuminate\Support\Composer. This is unlikely to affect your application if you were not manually using this class.

コマンドバスとハンドラCommands And Handlers

自己処理コマンドバスSelf-Handling Commands

ジョブやコマンドのSelfHandling契約を実装する必要は、もうありません。全ジョブは現在デフォルトで、自己処理型になりました。そのためクラスから、このインターフェイスは取り除いてください。You no longer need to implement the SelfHandling contract on your jobs / commands. All jobs are now self-handling by default, so you can remove this interface from your classes.

コマンドバスとハンドラの分離Separate Commands & Handlers

Laravel5.2コマンドバスは自己処理コマンドのみのサポートとなったため、コマンドとハンドラーの分離はもうサポートされません。The Laravel 5.2 command bus now only supports self-handling commands and no longer supports separate commands and handlers.

続けてコマンドとハンドラを分けて使いたい場合は、後方コンパチブルをサポートしているLaravel Collectiveパッケージをインストールしてください。(https://github.com/LaravelCollective/busIf you would like to continue using separate commands and handlers, you may install a Laravel Collective package which provides backwards-compatible support for this: https://github.com/LaravelCollective/bus[https://github.com/laravelcollective/bus]

設定Configuration

環境値Environment Value

app.php設定ファイルのenvオプションにデフォルト値が追加され、以下のようになりました。Add an env configuration option to your app.php configuration file that looks like the following:

'env' => env('APP_ENV', 'production'),

キャッシュとenvCaching And Env

config:cacheコマンドを開発中に使っている場合、設定ファイル中からのみenv関数を呼び出しており、アプリケーションの他の場所では使用していないことを確実に確かめるべきです。If you are using the config:cache command during deployment, you must make sure that you are only calling the env function from within your configuration files, and not from anywhere else in your application.

アプリケーション内部でenvを呼び出しているなら、envの呼び出しをconfigへ変換できるように、設定ファイルには実際の設定値を追加し、代わりにその場所からenvを呼び出す方法を強く推奨します。If you are calling env from within your application, it is strongly recommended you add proper configuration values to your configuration files and call env from that location instead, allowing you to convert your env calls to config calls.

コンパイル済みクラスCompiled Classes

config/compile.phpの中のfiles配列に、以下の2行があれば削除してください。If present, remove the following lines from config/compile.php in the files array:

realpath(__DIR__.'/../app/Providers/BusServiceProvider.php'),
realpath(__DIR__.'/../app/Providers/ConfigServiceProvider.php'),

上記のサービスプロバイダーが存在していないと、php artisan optimizeを実行時にエラーがでます。Not doing so can trigger an error when running php artisan optimize if the service providers listed here do not exist.

CSRFバリデーションCSRF Verification

CSRFバリデーションはユニットテスト時に自動的に実行されなくなりました。アプリケーションには影響はないでしょう。CSRF verification is no longer automatically performed when running unit tests. This is unlikely to affect your application.

データベースDatabase

MySQLの日付MySQL Dates

MySQL5.7以降では、strictモードがデフォルトで有効になったため、0000-00-00 00:00:00が有効な日付として取り扱われなくなりました。全タイムスタンプカラムは、データベースにレコードを挿入する時に、有効なデフォルト値を指定する必要があります。現時点のタイムスタンプをタイムスタンプカラムのデフォルト値にするため、マイグレーションでuseCurrentメソッドを使うか、null値を許可するためにnullableメソッドを指定してください。Starting with MySQL 5.7, 0000-00-00 00:00:00 is no longer considered a valid date, since strict mode is enabled by default. All timestamp columns should receive a valid default value when you insert records into your database. You may use the useCurrent method in your migrations to default the timestamp columns to the current timestamps, or you may make the timestamps nullable to allow null values:

$table->timestamp('foo')->nullable();

$table->timestamp('foo')->useCurrent();

$table->nullableTimestamps();

MySQL JSONカラムタイプMySQL JSON Column Type

jsonカラムはMySQLドライバにより、実際のJSONカラムが生成されるようになりました。MySQL5.7位上を使用していない場合、このカラムタイプは使用できません。代わりにtextカラムをマイグレーションで使用してください。The json column type now creates actual JSON columns when used by the MySQL driver. If you are not running MySQL 5.7 or above, this column type will not be available to you. Instead, use the text column type in your migration.

シーディングSeeding

データベースシーディング(初期値設定)を実行時、全Eloquentモデルは保護されなく(unguard)なりました。以前はModel::unguard()の呼び出しが必要でした。シーディング中にモデルの保護が必要であれば、DatabaseSeederクラスのトップでModel::reguard()を呼び出してください。When running database seeds, all Eloquent models are now unguarded by default. Previously a call to Model::unguard() was required. You can call Model::reguard() at the top of your DatabaseSeeder class if you would like models to be guarded during seeding.

EloquentEloquent

日付キャストDate Casts

モデルやモデルのコレクションでtoArrayを呼び出した時に、$castsプロパティにdatedatetimeとして追加した属性が、文字列に変換されるようになりました。これにより、日付キャスト変換が$dates配列で指定された日付と一貫性が取れるようになりました。Any attributes that have been added to your $casts property as date or datetime will now be converted to a string when toArray is called on the model or collection of models. This makes the date casting conversion consistent with dates specified in your $dates array.

グローバルスコープGlobal Scopes

グローバルスコープの実装が、とても使いやすくなるように実装しなおしました。グローバルスコープにはremoveメソッドは必要なくなりました。そのため、既に書かれたグローバルスコープから削除してください。The global scopes implementation has been re-written to be much easier to use. Your global scopes no longer need a remove method, so it may be removed from any global scopes you have written.

裏で動作しているクエリビルダインスタンスへアクセスするため、EloquentクエリビルダのgetQueryを呼び出しているなら、toBaseを呼び出すようにしてください。If you were calling getQuery on an Eloquent query builder to access the underlying query builder instance, you should now call toBase.

何らかの理由により、removeメソッドを直接呼び出している場合、代わりに$eloquentBuilder->withoutGlobalScope($scope)のように呼び出してください。If you were calling the remove method directly for any reason, you should change this call to $eloquentBuilder->withoutGlobalScope($scope).

新しくwithoutGlobalScopewithoutGlobalScopesメソッドをEloquentクエリビルダへ追加しました。$model->removeGlobalScopes($builder)の呼び出しは、$builder->withoutGlobalScopes()へ変更してください。New methods withoutGlobalScope and withoutGlobalScopes have been added to the Eloquent query builder. Any calls to $model->removeGlobalScopes($builder) may be changed to simply $builder->withoutGlobalScopes().

主キーPrimary keys

デフォルトでEloquentは主キーが整数と仮定しており、整数へ自動的にキャストしています。整数ではない主キーを使用している場合、Eloquentモデルの$incrementingプロパティをオーバーライドし、falseにしてください。By default, Eloquent assumes your primary keys are integers and will automatically cast them to integers. For any primary key that is not an integer you should override the $incrementing property on your Eloquent model to false:

/**
 * IDが自動増分
 *
 * @var bool
 */
public $incrementing = true;

イベントEvents

コアイベントオブジェクトCore Event Objects

Laravelが発行するコアイベントのいくつかが、文字列と動的パラメータの代わりに、イベントオブジェクトを使うようになりました。以下のリストは、旧イベント名とオブジェクトベースの対応するイベントクラスです。Some of the core events fired by Laravel now use event objects instead of string event names and dynamic parameters. Below is a list of the old event names and their new object based counterparts:

旧イベント名Old 新イベントクラスNew
artisan.startartisan.start Illuminate\Console\Events\ArtisanStartingIlluminate\Console\Events\ArtisanStarting
auth.attemptingauth.attempting Illuminate\Auth\Events\AttemptingIlluminate\Auth\Events\Attempting
auth.loginauth.login Illuminate\Auth\Events\LoginIlluminate\Auth\Events\Login
auth.logoutauth.logout Illuminate\Auth\Events\LogoutIlluminate\Auth\Events\Logout
cache.missedcache.missed Illuminate\Cache\Events\CacheMissedIlluminate\Cache\Events\CacheMissed
cache.hitcache.hit Illuminate\Cache\Events\CacheHitIlluminate\Cache\Events\CacheHit
cache.writecache.write Illuminate\Cache\Events\KeyWrittenIlluminate\Cache\Events\KeyWritten
cache.deletecache.delete Illuminate\Cache\Events\KeyForgottenIlluminate\Cache\Events\KeyForgotten
connection.{name}.beginTransactionconnection.{name}.beginTransaction Illuminate\Database\Events\TransactionBeginningIlluminate\Database\Events\TransactionBeginning
connection.{name}.committedconnection.{name}.committed Illuminate\Database\Events\TransactionCommittedIlluminate\Database\Events\TransactionCommitted
connection.{name}.rollingBackconnection.{name}.rollingBack Illuminate\Database\Events\TransactionRolledBackIlluminate\Database\Events\TransactionRolledBack
illuminate.queryilluminate.query Illuminate\Database\Events\QueryExecutedIlluminate\Database\Events\QueryExecuted
illuminate.queue.beforeilluminate.queue.before Illuminate\Queue\Events\JobProcessingIlluminate\Queue\Events\JobProcessing
illuminate.queue.afterilluminate.queue.after Illuminate\Queue\Events\JobProcessedIlluminate\Queue\Events\JobProcessed
illuminate.queue.failedilluminate.queue.failed Illuminate\Queue\Events\JobFailedIlluminate\Queue\Events\JobFailed
illuminate.queue.stoppingilluminate.queue.stopping Illuminate\Queue\Events\WorkerStoppingIlluminate\Queue\Events\WorkerStopping
mailer.sendingmailer.sending Illuminate\Mail\Events\MessageSendingIlluminate\Mail\Events\MessageSending
router.matchedrouter.matched Illuminate\Routing\Events\RouteMatchedIlluminate\Routing\Events\RouteMatched

各イベントオブジェクトはLaravel5.1のイベントハンドラへ渡されていたものと、完全に同じパラメータを含んでいます。たとえば、5.1.*のDB::listenを使用していたなら、5.2では次のように更新します。Each of these event objects contains exactly the same parameters that were passed to the event handler in Laravel 5.1. For example, if you were using DB::listen in 5.1., you may update your code like so for 5.2.:

DB::listen(function ($event) {
    dump($event->sql);
    dump($event->bindings);
});

新しいオブジェクトクラスを調べ、publicプロパティを確認してください。You may check out each of the new event object classes to see their public properties.

例外ハンドラException Handling

App\Exceptions\Handlerクラスの$dontReportプロパティは以下の例外タイプの最低1つを含むように更新してください。Your App\Exceptions\Handler class' $dontReport property should be updated to include at least the following exception types:

use Illuminate\Validation\ValidationException;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Symfony\Component\HttpKernel\Exception\HttpException;

/**
 * レポートしたくない例外のリスト
 *
 * @var array
 */
protected $dontReport = [
    AuthorizationException::class,
    HttpException::class,
    ModelNotFoundException::class,
    ValidationException::class,
];

ヘルパ関数Helper Functions

url()ヘルパ関数が、引数のパスの指定がない場合にIlluminate\Routing\UrlGeneratorを返すようになりました。The url() helper function now returns a Illuminate\Routing\UrlGenerator instance when no path is provided.

暗黙のモデル結合Implicit Model Binding

Laravel5.2は「暗黙のモデル結合」を導入しました。URIに現れる識別子を元にルートとコントローラへモデルインスタンスを自動的に依存注入する新しい機能です。しかし、これによりモデルインスタンスをタイプヒントしたルートとコントローラの振る舞いがかわりました。Laravel 5.2 includes "implicit model binding", a convenient new feature to automatically inject model instances into routes and controllers based on the identifier present in the URI. However, this does change the behavior of routes and controllers that type-hint model instances.

ルートやコントローラでモデルインスタンスをタイプヒントし、空のモデルインスタンスが注入されることを期待している場合、タイプヒントを削除し、ルートかコントローラ内で直接空のモデルを生成してください。そうしなければ、LaravelはルートURIにあるIDを元にデータベースから既存のモデルインスタンスを取得しようとします。If you were type-hinting a model instance in your route or controller and were expecting an empty model instance to be injected, you should remove this type-hint and create an empty model instance directly within your route or controller; otherwise, Laravel will attempt to retrieve an existing model instance from the database based on the identifier present in the route's URI.

IronMQIronMQ

IronMQキュードライバーはそれ自身のパッケージから削除されたため、コアフレームワークには含まれなくなりました。The IronMQ queue driver has been moved into its own package and is no longer shipped with the core framework.

http://github.com/LaravelCollective/iron-queue

ジョブ/キューJobs / Queue

php artisan make:jobコマンドは、デフォルトで「キュー投入(queued)」ジョブクラスを定義するようになりました。「同期(sync)」ジョブを生成したい場合は、コマンド実行時に--syncオプションを付けてください。The php artisan make:job command now creates a "queued" job class definition by default. If you would like to create a "sync" job, use the --sync option when issuing the command.

メールMail

pretendメール設定オプションは削除されました。代わりにlogメールドライバを使ってください。pretendと同じ機能で、メールメッセージについてより情報がログされます。The pretend mail configuration option has been removed. Instead, use the log mail driver, which performs the same function as pretend and logs even more information about the mail message.

ペジネーションPagination

フレームワークが生成する他のURLとの一貫性を保つため、ペジネーションURLは最後のスラッシュを含まないようになりました。これがアプリケーションに影響を与えることはないでしょう。To be consistent with other URLs generated by the framework, the paginator URLs no longer contain a trailing slash. This is unlikely to affect your application.

サービスプロバイダService Providers

app.php設定ファイルのサービスプロバイダリストから、Illuminate\Foundation\Providers\ArtisanServiceProviderを削除してください。The Illuminate\Foundation\Providers\ArtisanServiceProvider should be removed from your service provider list in your app.php configuration file.

app.php設定ファイルのサービスプロバイダリストから、Illuminate\Routing\ControllerServiceProviderを削除してください。The Illuminate\Routing\ControllerServiceProvider should be removed from your service provider list in your app.php configuration file.

セッションSessions

認証システムの変更により、Laravel5.2へアップグレードした時点で、既存のセッションは無効になります。Because of changes to the authentication system, any existing sessions will be invalidated when you upgrade to Laravel 5.2.

データベースセッションドライバDatabase Session Driver

ユーザID、IPアドレス、ユーザエージェントのような情報をより含む、新しいdatabaseセッションドライバが書かれました。古いドライバーを使い続けたい場合は、session.php設定ファイルへlegacy-databaseドライバを指定してください。A new database session driver has been written for the framework which includes more information about the user such as their user ID, IP address, and user-agent. If you would like to continue using the old driver you may specify the legacy-database driver in your session.php configuration file.

新しいドライバーを使用する場合、セッションのデータベーステーブルへ、user_id (NULL値を許す整数)ip_address (NULL値を許す整数)user_agent (テキスト)カラムを追加してください。If you would like to use the new driver, you should add the user_id (nullable integer), ip_address (nullable string), and user_agent (text) columns to your session database table.

StringyStringy

"Stringy"ライブラリはフレームワーク含まれなくなりました。アプリケーションで使用したい場合は、Composerを使いインストールしてください。The "Stringy" library is no longer included with the framework. You may install it manually via Composer if you wish to use it in your application.

バリデーションValidation

例外タイプException Types

ValidatesRequestsトレイトはIlluminate\Http\Exception\HttpResponseExceptionインスタンスの代わりに、Illuminate\Foundation\Validation\ValidationExceptionインスタンスを投げるようになりました。自分でこの例外を補足していなければ、アプリケーションに影響はないでしょう。The ValidatesRequests trait now throws an instance of Illuminate\Foundation\Validation\ValidationException instead of throwing an instance of Illuminate\Http\Exception\HttpResponseException. This is unlikely to affect your application unless you were manually catching this exception.

非推奨Deprecations

以下の機能は5.2で非推奨になり、2016年6月の5.3のリリースで削除されます。The following features are deprecated in 5.2 and will be removed in the 5.3 release in June 2016:

  • Illuminate\Contracts\Bus\SelfHandling契約。ジョブから削除してください。Illuminate\Contracts\Bus\SelfHandling contract. Can be removed from jobs.
  • コレクション、クエリビルダ、Eloquentクエリビルダオブジェクトのlistsメソッドはpluckヘリネームされました。メソッドの使い方は同じです。The lists method on the Collection, query builder and Eloquent query builder objects has been renamed to pluck. The method signature remains the same.
  • Route::controllerを使う暗黙のコントローラルート定義は非推奨になりました。ルートファイルで明確に定義してください。これはパッケージから削除されます。Implicit controller routes using Route::controller have been deprecated. Please use explicit route registration in your routes file. This will likely be extracted into a package.
  • getpostやその他のルート定義ヘルパ関数は削除されます。代わりにRouteファサードを使ってください。The get, post, and other route helper functions have been removed. You may use the Route facade instead.
  • 5.1のdatabaseセッションドライバーはlegacy-databaseヘリネームされ、削除予定です。前述の「データベースセッションドライバ」をお読みください。The database session driver from 5.1 has been renamed to legacy-database and will be removed. Consult notes on the "database session driver" above for more information.
  • PHPが持っているrandom_bytes関数がより好ましいため、Str::randomBytes関数は非推奨になりました。The Str::randomBytes function has been deprecated in favor of the random_bytes native PHP function.
  • PHPが持っているhash_equals関数がより好ましいため、Str::equals関数は非推奨になりました。The Str::equals function has been deprecated in favor of the hash_equals native PHP function.
  • Illuminate\Support\HtmlStringがより好ましいため、Illuminate\View\Expressionは非推奨になりました。Illuminate\View\Expression has been deprecated in favor of Illuminate\Support\HtmlString.
  • WincacheStoreキャッシュドライバーは削除されました。The WincacheStore cache driver has been removed.

5.1.11へのアップグレードUpgrading To 5.1.11

Laravel5.1.11は認可ポリシーをサポートします。既存のLaravel5.1アプリケーションへこれらの新しい機能を組み込むのも簡単です。Laravel 5.1.11 includes support for authorization[/docs/{{version}}/authorization] and policies[/docs/{{version}}/authorization#policies]. Incorporating these new features into your existing Laravel 5.1 applications is simple.

注目: これらのアップグレードは任意です。行わなくてもアプリケーションの実行に影響は与えません。Note: These upgrades are optional, and ignoring them will not affect your application.

ポリシーディレクトリの作成Create The Policies Directory

まずアプリケーションへ空のapp/Policiesディレクトリを作成してください。First, create an empty app/Policies directory within your application.

AuthServiceProviderとGateファサードの作成と登録Create / Register The AuthServiceProvider & Gate Facade

app/ProvidersディレクトリにAuthServiceProviderを作成します。 GitHubからデフォルトプロバイダの内容をコピーしてください。もしアプリケーションでカスタム名前空間を使用している場合はプロバイダの名前空間を変更してください。プロバイダを作成したら、app.php設定ファイルのproviders配列へ確実に登録してください。Create a AuthServiceProvider within your app/Providers directory. You may copy the contents of the default provider from GitHub[https://raw.githubusercontent.com/laravel/laravel/master/app/Providers/AuthServiceProvider.php]. Remember to change the provider's namespace if your application is using a custom namespace. After creating the provider, be sure to register it in your app.php configuration file's providers array.

さらに、Gateファサードをapp.phpファイルのaliases配列へ登録する必要もあります。Also, you should register the Gate facade in your app.php configuration file's aliases array:

'Gate' => Illuminate\Support\Facades\Gate::class,

Userモデルの更新Update The User Model

手順の2つ目は、App\UserモデルへIlluminate\Foundation\Auth\Access\Authorizableトレイトのuseと、Illuminate\Contracts\Auth\Access\Authorizable契約を追加します。Secondly, use the Illuminate\Foundation\Auth\Access\Authorizable trait and Illuminate\Contracts\Auth\Access\Authorizable contract on your App\User model:

<?php

namespace App;

use Illuminate\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Foundation\Auth\Access\Authorizable;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;

class User extends Model implements AuthenticatableContract,
                                    AuthorizableContract,
                                    CanResetPasswordContract
{
    use Authenticatable, Authorizable, CanResetPassword;
}

ベースコントローラーの更新Update The Base Controller

続いて、App\Http\Controllers\ControllerベースコントローラーでIlluminate\Foundation\Auth\Access\AuthorizesRequestsトレイトをuseするように更新します。Next, update your base App\Http\Controllers\Controller controller to use the Illuminate\Foundation\Auth\Access\AuthorizesRequests trait:

<?php

namespace App\Http\Controllers;

use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;

abstract class Controller extends BaseController
{
    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
}

5.1.0へのアップグレードUpgrading To 5.1.0

アップデートにかかる時間の見積もり:1時間以下Estimated Upgrade Time: Less Than 1 Hour

bootstrap/autoload.phpの更新Update bootstrap/autoload.php

bootstrap/autoload.phpの中の$compiledPath変数を次のように変更してください。Update the $compiledPath variable in bootstrap/autoload.php to the following:

$compiledPath = __DIR__.'/cache/compiled.php';

bootstrap/cacheディレクトリ作成Create bootstrap/cache Directory

bootstrapディレクトリの中に、cacheディレクトリ(bootstrap/cache)を作成してください。.gitignoreファイルをこのディレクトリに以下の内容で作成してください。Within your bootstrap directory, create a cache directory (bootstrap/cache). Place a .gitignore file in this directory with the following contents:

*
!.gitignore

compiled.phproutes.phpconfig.phpservices.jsonなど一時的な最適化のためのファイルをフレームワークが保存するために使用します。This directory should be writable, and will be used by the framework to store temporary optimization files like compiled.php, routes.php, config.php, and services.json.

BroadcastServiceProviderプロバイダ追加Add BroadcastServiceProvider Provider

config/app.php設定ファイルのproviders配列にIlluminate\Broadcasting\BroadcastServiceProviderを追加します。Within your config/app.php configuration file, add Illuminate\Broadcasting\BroadcastServiceProvider to the providers array.

認証Authentication

AuthenticatesAndRegistersUsersトレイトを使用しているAuthControllerを使用している場合は、新しいユーザのバリデーションと生成方法に多少変更が必要です。If you are using the provided AuthController which uses the AuthenticatesAndRegistersUsers trait, you will need to make a few changes to how new users are validated and created.

最初に、GuardRegistrarをベースのコンストラクターに渡す必要は無くなりました。コントローラーのコンストラクターから、これらの依存指定を削除できます。First, you no longer need to pass the Guard and Registrar instances to the base constructor. You can remove these dependencies entirely from your controller's constructor.

次に、Laravel5.0で使用していたApp/Services/Registrarクラスは必要ありません。このクラスからvalidatorcreateメソッドをそのままAuthControllerにコピー&ペーストしてください。これ以上の変更は必要ありませんが、AuthControllerの最初でValidatorファサードとUserモデルをインポートする必要はあるでしょう。Secondly, the App\Services\Registrar class used in Laravel 5.0 is no longer needed. You can simply copy and paste your validator and create method from this class directly into your AuthController. No other changes should need to be made to these methods; however, you should be sure to import the Validator facade and your User model at the top of your AuthController.

PasswordコントローラーPassword Controller

Laravelに含まれているPasswordControllerは、依存をコンストラクターで要求する必要が無くなりました。5.0以下で必要であった依存は両方共取り除いてください。The included PasswordController no longer requires any dependencies in its constructor. You may remove both of the dependencies that were required under 5.0.

バリデーションValidation

もしベースコントローラクラスのformatValidationErrorsメソッドをオーバーライドしているなら、Illuminate\Validation\Validator具象クラスの代わりにIlluminate\Contracts\Validation\Validator契約をタイプヒントで指定する必要があります。If you are overriding the formatValidationErrors method on your base controller class, you should now type-hint the Illuminate\Contracts\Validation\Validator contract instead of the concrete Illuminate\Validation\Validator instance.

同様に、ベースコントローラークラスのformatErrorsメソッドをオーバーライドしているなら、Illuminate\Validation\Validator具象クラスの代わりにIlluminate\Contracts\Validation\Validator契約をタイプヒントで指定する必要があります。Likewise, if you are overriding the formatErrors method on the base form request class, you should now type-hint Illuminate\Contracts\Validation\Validator contract instead of the concrete Illuminate\Validation\Validator instance.

マイグレーションMigrations

SQLiteデータベースのカラム名を変更したり、カラムをドロップするマイグレーションが存在する場合、composer.jsonファイルにdoctrine/dbal依存パッケージを追加し、このライブラリをインストールするために、端末でcomposer updateコマンドを実行する必要があります。If you have any migrations that rename a column or any migrations that drop columns from a SQLite database, you will need to add the doctrine/dbal dependency to your composer.json file and run the composer update command in your terminal to install the library.

EloquentEloquent

createメソッドThe create Method

Eloquentのcreateメソッドが引数無しで呼び出せるようになりました。もしモデルのcreateメソッドをオーバーライドしている場合は、$attributes引数にデフォルト値として配列を指定してください。Eloquent's create method can now be called without any parameters. If you are overriding the create method in your own models, set the default value of the $attributes parameter to an array:

public static function create(array $attributes = [])
{
    // カスタム実装…
}

findメソッドThe find Method

モデルでfindメソッドをオーバーライドし、そのカスタムメソッド中でparent::find()を呼んでいるなら、Eloquentクエリビルダのfindメソッドを呼び出すように変更してください。If you are overriding the find method in your own models and calling parent::find() within your custom method, you should now change it to call the find method on the Eloquent query builder:

public static function find($id, $columns = ['*'])
{
    $model = static::query()->find($id, $columns);

    // ...

    return $model;
}

listsメソッドThe lists Method

Eloquentのクエリ―のlistsメソッドは通常の配列の代わりに「コレクション」インスタンスを返すようになりました。コレクションを通常の配列に変換したい場合は、allメソッドを使用してください。The lists method now returns a Collection instance instead of a plain array for Eloquent queries. If you would like to convert the Collection into a plain array, use the all method:

User::lists('id')->all();

クエリビルダのlistsはそのまま配列を返すことに注意してください。Be aware that the Query Builder lists method still returns an array.

日付のフォーマットDate Formatting

これまでは保存されるEloquentの日付フィールドのフォーマットは、モデルのgetDateFormatメソッドをオーバーライドすることで変更できました。これはまだ有効ですが、メソッドをオーバーライドする代わりに、モデルインスタンスの$dateFormatプロパティーを指定するほうが簡単で便利でしょう。Previously, the storage format for Eloquent date fields could be modified by overriding the getDateFormat method on your model. This is still possible; however, for convenience you may simply specify a $dateFormat property on the model instead of overriding the method.

日付フォーマットはモデルを配列やJSONにシリアライズするときにも適用されるようになりました。Laravelを5.0から5.1へアップグレードすると、JSONシリアライズされたデータフィールドのフォーマットは変わってしまいます。シリアライズされるモデルへ日付フォーマットを指定するには、モデルのserializeDate(DateTime $date)メソッドをオーバーライドしてください。このメソッドにより、保存されるフォーマットを変更せずに、シリアライズされるEloquentの日付フィールドのフォーマットを柔軟にコントロールできます。The date format is also now applied when serializing a model to an array or JSON. This may change the format of your JSON serialized date fields when migrating from Laravel 5.0 to 5.1. To set a specific date format for serialized models, you may override the serializeDate(DateTime $date) method on your model. This method allows you to have granular control over the formatting of serialized Eloquent date fields without changing their storage format.

コレクションクラスThe Collection Class

sortメソッドThe sort Method

sortメソッドは既存のコレクションを変更する代わりに、新しいコレクションインスタンスを返すようになりました。The sort method now returns a fresh collection instance instead of modifying the existing collection:

$collection = $collection->sort($callback);

sortByメソッドThe sortBy Method

sortByメソッドは既存のコレクションを更新する代わりに、新しいコレクションインスタンスを返すようになりました。The sortBy method now returns a fresh collection instance instead of modifying the existing collection:

$collection = $collection->sortBy('name');

groupByメソッドThe groupBy Method

groupBeメソッドは親のCollectionの中の各アイテムごとにCollectionを返すようになりました。全アイテムをプレーンな配列に戻したい場合は、mapを適用してください。The groupBy method now returns Collection instances for each item in the parent Collection. If you would like to convert all of the items back to plain arrays, you may map over them:

$collection->groupBy('type')->map(function($item)
{
    return $item->all();
});

listsメソッドThe lists Method

listsメソッドは通常の配列の代わりに「コレクション」インスタンスを返すようになりました。コレクションを通常の配列に変換したい場合は、allメソッドを使用してください。The lists method now returns a Collection instance instead of a plain array. If you would like to convert the Collection into a plain array, use the all method:

$collection->lists('id')->all();

コマンドとハンドラCommands & Handlers

app/Commandsディレクトリはapp/Jobsへ名前が変更されました。しかし、コマンドを全部新しい場所へ移動する必要はありませんし、make:commandhandler:command Artisanコマンドも続けて使用できます。The app/Commands directory has been renamed to app/Jobs. However, you are not required to move all of your commands to the new location, and you may continue using the make:command and handler:command Artisan commands to generate your classes.

同様に、app/Handlersディレクトリはapp/Listenersに名前が変更され、イベントリスナだけが含まれるようになりました。しかし、既に存在するコマンドとイベントハンドラを移動したり、名前を変えたりする必要はありません。handler:eventコマンドもイベントハンドラを生成するために続けて使用できます。Likewise, the app/Handlers directory has been renamed to app/Listeners and now only contains event listeners. However, you are not required to move or rename your existing command and event handlers, and you may continue to use the handler:event command to generate event handlers.

Laravel5.0フォルダー構造との後方互換性を提供しているので、アプリケーションをLaravel5.1へアップグレードし、都合の良い時にイベントとコマンドを新しい場所へゆっくりアップグレードしてください。By providing backwards compatibility for the Laravel 5.0 folder structure, you may upgrade your applications to Laravel 5.1 and slowly upgrade your events and commands to their new locations when it is convenient for you or your team.

BladeBlade

BladeコンパイラーからcreateMatchercreateOpenMatchercreatePlainMatcherメソッドが削除されました。Laravel5.1のBladeでは新しいdirectiveメソッドでカスタムディレクティブを作成してください。Bladeの拡張のドキュメントで詳細を確認してください。The createMatcher, createOpenMatcher, and createPlainMatcher methods have been removed from the Blade compiler. Use the new directive method to create custom directives for Blade in Laravel 5.1. Consult the extending blade[/docs/{{version}}/blade#extending-blade] documentation for more information.

テストTests

tests/TestCase.phpファイルにprotectedの$baseUrlプロパティーを追加してください。Add the protected $baseUrl property to the tests/TestCase.php file:

protected $baseUrl = 'http://localhost';

言語ファイルTranslation Files

ベンダーパッケージの公開言語ファイルのデフォルトディレクトリが変更になりました。ベンダーパッケージ言語ファイルはresources/lang/パッケージ/{ローカル}/{名前空間}からresources/lang/ベンダー/{名前空間}/{ローカル}へ移動してください。たとえばAcme/Anvilパッケージのacme/anvil::foo名前空間、英語の言語ファイルはresources/lang/packages/en/acme/anvil/foo.phpからresources/lang/vendor/acme/anvil/en/foo.phpへ移動します。The default directory for published language files for vendor packages has been moved. Move any vendor package language files from resources/lang/packages/{locale}/{namespace} to resources/lang/vendor/{namespace}/{locale} directory. For example, Acme/Anvil package's acme/anvil::foo namespaced English language file would be moved from resources/lang/packages/en/acme/anvil/foo.php to resources/lang/vendor/acme/anvil/en/foo.php.

Amazon WebサービスSDKAmazon Web Services SDK

AWS SQSキュードライバかAWS SES メールドライバを使っている場合は、インストール済みのAWS PHP SDKをバージョン3.0へアップデートする必要があります。If you are using the AWS SQS queue driver or the AWS SES e-mail driver, you should update your installed AWS PHP SDK to version 3.0.

Amazon S3ファイルシステムドライバを使用している場合は、コンポーザにより対応するファイルシステムパッケージを更新する必要があります。If you are using the Amazon S3 filesystem driver, you will need to update the corresponding Flysystem package via Composer:

  • Amazon S3: league/flysystem-aws-s3-v3 ~1.0Amazon S3: league/flysystem-aws-s3-v3 ~1.0

非推奨Deprecations

以下のLaravelの機能は非推奨になり、2015年12月にリリースされるLaravel 5.2で完全に削除されます。The following Laravel features have been deprecated and will be removed entirely with the release of Laravel 5.2 in December 2015:

- より好ましい[ミドルウェア](/docs/{{version}}/middleware)により、ルートフィルターは非推奨となりました。 - `Illuminate\Contracts\Routing\Middleware`契約は非推奨になりました。ミドルウェアには契約が必要ありません。さらに、`TerminableMiddleware`契約も非推奨になりました。インターフェイスの代わりに、ミドルウェアで`terminate`メソッドをシンプルに定義するだけです。 - より好ましい`Illuminate\Contracts\Queue\ShouldQueue`により、`Illuminate\Contracts\Queue\ShouldBeQueued`契約は非推奨となりました。 - Iron.ioの「Pushキュー」は非推奨となり、通常のIron.ioキューと[queue listeners](/docs/{{version}}/queues#running-the-queue-listener)の使用が推奨されます。 - `Illuminate\Foundation\Bus\DispatchesCommands`トレイトは非推奨となりました。リネームされた`Illuminate\Foundation\Bus\DispatchesJobs`を使用してください。 - `Illuminate\Container\BindingResolutionException`は非推奨となり、代わりに`Illuminate\Contracts\Container\BindingResolutionException`となります。 - サービスコンテナの`bindShared`メソッドは非推奨となり、より好ましい`singleton`メソッドが推奨されます。 - Eloquentとクエリビルダの`pluck`メソッドは非推奨となり、`value`へリネームされました。 - コレクションの`fetch`メソッドは非推奨となり、`pluck`メソッドが推奨されます。 - `array_fetch`ヘルパは非推奨となり、より好ましい`array_pluck`メソッドが推奨されます。

5.0.16へのアップグレードUpgrading To 5.0.16

bootstrap/autoload.phpファイル中の$compiledPath変数を変更してください。In your bootstrap/autoload.php file, update the $compiledPath variable to:

$compiledPath = __DIR__.'/../vendor/compiled.php';

サービスプロバイダService Providers

app.php設定ファイルのサービスプロバイダリストから、App\Providers\BusServiceProviderを削除してください。The App\Providers\BusServiceProvider may be removed from your service provider list in your app.php configuration file.

app.php設定ファイルのサービスプロバイダリストから、App\Providers\ConfigServiceProviderを削除してください。The App\Providers\ConfigServiceProvider may be removed from your service provider list in your app.php configuration file.

4.2から5.0へのアップグレードUpgrading To 5.0 From 4.2

新しくインストール、その後で移行Fresh Install, Then Migrate

推奨するアップグレード方法は、新しくLaravel5.0をインストールし、それから4.2サイト独自のファイルを新しくインストールした環境へコピーすることです。コピーするファイルにはコントローラー、ルート、Eloquentモデル、Artisanコマンド、アセット、その他あなたのアプリケーション限定のコードを含みます。The recommended method of upgrading is to create a new Laravel 5.0 install and then to copy your 4.2 site's unique application files into the new application. This would include controllers, routes, Eloquent models, Artisan commands, assets, and other code specific files to your application.

まずローカル環境の新しいディレクトリへLaravel5.0アプリケーションをインストールしてください。5.0よりも新しいバージョンはインストールしないでください。最初に5.0へのマイグレーションを完了させる必要があります。各手順の詳細は、以降で紹介します。To start, install a new Laravel 5.0 application[/docs/5.0/installation] into a fresh directory in your local environment. Do not install any versions newer than 5.0 yet, since we need to complete the migration steps for 5.0 first. We'll discuss each piece of the migration process in further detail below.

Composerの依存とパッケージComposer Dependencies & Packages

追加しているComposerの依存パッケージを5.0アプリケーションへコピーするのを忘れないでください。SDKのような、サードパーティのコードも忘れずに。Don't forget to copy any additional Composer dependencies into your 5.0 application. This includes third-party code such as SDKs.

リリース後しばらく、Laravel限定のパッケージはLaravel5と互換性がないかも知れません。Laravel5向きの対応バージョンが用意されるか、メンテナーに確認しましょう。Composerの依存パッケージをアプリケーションに追加したら、composer updataを実行する必要があります。Some Laravel-specific packages may not be compatible with Laravel 5 on initial release. Check with your package's maintainer to determine the proper version of the package for Laravel 5. Once you have added any additional Composer dependencies your application needs, run composer update.

名前空間Namespacing

Laravel4のデフォルトでは、アプリケーションのコードに名前空間は使用されていません。そのため、例えば、全Eloquentモデルとコントローラーは、ただ「グローバル」な名前空間下に置かれています。手早く移行するには、Laravel5でも同様にグローバル名前空間下へ、それらのクラスを設置しましょう。By default, Laravel 4 applications did not utilize namespacing within your application code. So, for example, all Eloquent models and controllers simply lived in the "global" namespace. For a quicker migration, you can simply leave these classes in the global namespace in Laravel 5 as well.

設定Configuration

環境変数の移行Migrating Environment Variables

新しい.env.exampleファイルを.envへコピーします。古いバージョンの.env.phpファイルに該当します。APP_ENVAPP_KEY(暗号化キー)、データベース接続情報、キャッシュやセッションのドライバのような値を適切に設置してください。Copy the new .env.example file to .env, which is the 5.0 equivalent of the old .env.php file. Set any appropriate values there, like your APP_ENV and APP_KEY (your encryption key), your database credentials, and your cache and session drivers.

さらに、古い.env.phpファイル中で変更した値を.env(ローカル環境で本当に使用される値)と.env.example(他のチームメンバーに参考にしてもらう値)にコピーします。Additionally, copy any custom values you had in your old .env.php file and place them in both .env (the real value for your local environment) and .env.example (a sample instructional value for other team members).

環境設定の詳細は、ドキュメントを読んでください。For more information on environment configuration, view the full documentation[/docs/{{version}}/installation#environment-configuration].

注意: Laravel5アプリケーションを本番サーバーへデプロイする前に、適切な値を設置した.envファイルを用意しておく必要があります。Note: You will need to place the appropriate .env file and values on your production server before deploying your Laravel 5 application.

設定ファイルConfiguration Files

Laravel5.0では、特定の環境のために設定ファイルを指定する、app/config/{環境名}/ディレクトリ構造はもう使われません。代わりに、各環境に用意する.envへ設定値を移動します。それから、設定ファイル中でenv('キー', 'デフォルト値')を使用して、値にアクセスします。config/database.php設定ファイルに設定例があります。Laravel 5.0 no longer uses app/config/{environmentName}/ directories to provide specific configuration files for a given environment. Instead, move any configuration values that vary by environment into .env, and then access them in your configuration files using env('key', 'default value'). You will see examples of this in the config/database.php configuration file.

configディレクトリ下の設定ファイルには、全環境に渡り変更しない値を直接設置するか、環境ごとに変化する値をロードするためenv()を使うか、どちらかで設定値を指定します。Set the config files in the config/ directory to represent either the values that are consistent across all of your environments, or set them to use env() to load values that vary by environment.

.envファイルにキーを追加したら、同様に参考値を.env.exampleファイルへ追加するのを忘れないでください。これにより、あなたのチームメンバーが自分の.envファイルを作成しやすくなります。Remember, if you add more keys to .env file, add sample values to the .env.example file as well. This will help your other team members create their own .env files.

ルートRoutes

古いroutes.phpを新しいapp/Http/routes.phpへ、コピー&貼付けしてください。Copy and paste your old routes.php file into your new app/Http/routes.php.

コントローラーControllers

次に、全コントローラーをapp/Http/Controllersディレクトリへ移動します。このガイドでは名前空間を利用した以降を行わないため、composer.jsonファイルのclassmapディレクティブへ、app/Http/Controllersを追加してください。次に、app/Http/Controllers/Controller.php抽象ベースクラスから、名前空間を削除します。移行するコントローラーはこのベースクラスを拡張していることを確認してください。Next, move all of your controllers into the app/Http/Controllers directory. Since we are not going to migrate to full namespacing in this guide, add the app/Http/Controllers directory to the classmap directive of your composer.json file. Next, you can remove the namespace from the abstract app/Http/Controllers/Controller.php base class. Verify that your migrated controllers are extending this base class.

app/Providers/RouteServiceProvider.phpファイルの中で、namespaceプロパティをnullに設定してください。In your app/Providers/RouteServiceProvider.php file, set the namespace property to null.

ルートフィルターRoute Filters

フィルターの定義をapp/filters.phpから、app/Providers/RouteServiceProvider.phpboot()メソッドの中へコピーします。app/Providers/RouteServiceProvider.phpuse Illuminate\Support\Facades\Route;の1行を追加し、Routeファサードを使い続けられるようにします。Copy your filter bindings from app/filters.php and place them into the boot() method of app/Providers/RouteServiceProvider.php. Add use Illuminate\Support\Facades\Route; in the app/Providers/RouteServiceProvider.php in order to continue using the Route Facade.

authcsrfのような、Laravel4デフォルトフィルターは移動しないでください。ミドルウェアとしてLaravel5に用意されています。ルートやコントローラーで、古いデフォルトフィルターの使用箇所(例えば、['before' => 'auth'])を新しいミドルウェアを使用するように書き換えてください。(例えば、['middleware' => 'auth']You do not need to move over any of the default Laravel 4.0 filters such as auth and csrf; they're all here, but as middleware. Edit any routes or controllers that reference the old default filters (e.g. ['before' => 'auth']) and change them to reference the new middleware (e.g. ['middleware' => 'auth'].)

フィルターはLaravel5でも廃止されていません。カスタムフィルターを定義して、beforeafterを使用し指定できます。Filters are not removed in Laravel 5. You can still bind and use your own custom filters using before and after.

グローバルCSRFGlobal CSRF

デフォルトで、CSRF保護が、全ルートで有効になりました。これを無効にするか、特定のルートだけに手動で有効にしたいのでしたら、以下の行をApp\Http\Kernelファイル中のmiddleware配列から削除してください。By default, CSRF protection[/docs/{{version}}/routing#csrf-protection] is enabled on all routes. If you'd like to disable this, or only manually enable it on certain routes, remove this line from App\Http\Kernel's middleware array:

'App\Http\Middleware\VerifyCsrfToken',

続いて、次の1行を$routeMiddlewareに追加します。If you want to use it elsewhere, add this line to $routeMiddleware:

'csrf' => 'App\Http\Middleware\VerifyCsrfToken',

これで、個別のルート/コントローラーに対し、['middleware' => 'csrf']を指定することで、ミドルウェアを追加できるようになります。ミドルウェアの詳細は、ドキュメントを参照してください。Now you can add the middleware to individual routes / controllers using ['middleware' => 'csrf'] on the route. For more information on middleware, consult the full documentation[/docs/{{version}}/middleware].

EloquentモデルEloquent Models

Eloquentモデルを設置するために、app/Modelsディレクトリを作成することもできます。その場合、このディレクトリをcomposer.jsonclassmapディレクティブへ追加してください。Feel free to create a new app/Models directory to house your Eloquent models. Again, add this directory to the classmap directive of your composer.json file.

SoftDeletingTraitを使用しているモデルでは、Illuminate\Database\Eloquent\SoftDeletesを使うように変更します。Update any models using SoftDeletingTrait to use Illuminate\Database\Eloquent\SoftDeletes.

EloquentキャッシュEloquent Caching

Eloquentは、クエリ結果をキャッシュするためのrememberメソッドを提供しなくなりました。Cache::remember機能を使用し、手動でクエリをキャッシュする必要があります。キャッシュの詳細は、ドキュメントに全て記載されています。Eloquent no longer provides the remember method for caching queries. You now are responsible for caching your queries manually using the Cache::remember function. For more information on caching, consult the full documentation[/docs/{{version}}/cache].

User認証モデルUser Authentication Model

UserモデルをLaravel5の認証システム向けにアップグレードするには、以下の指示に従ってください。To upgrade your User model for Laravel 5's authentication system, follow these instructions:

useブロックから、以下の行を削除するDelete the following from your use block:

use Illuminate\Auth\UserInterface;
use Illuminate\Auth\Reminders\RemindableInterface;

useブロックに、以下の行を追加するAdd the following to your use block:

use Illuminate\Auth\Authenticatable;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;

UserInterfaceとRemindableInterfaceインターフェイスを削除するRemove the UserInterface and RemindableInterface interfaces.

クラスで以下のインターフェイスを実装宣言するMark the class as implementing the following interfaces:

implements AuthenticatableContract, CanResetPasswordContract

クラスの宣言で、以下のトレイトを取り込むInclude the following traits within the class declaration:

use Authenticatable, CanResetPassword;

この方法を取る場合、クラスのuse宣言ブロックから、Illuminate\Auth\Reminders\RemindableTraitIlluminate\Auth\UserTraitを取り除いてください。If you used them, remove Illuminate\Auth\Reminders\RemindableTrait and Illuminate\Auth\UserTrait from your use block and your class declaration.

Cashierの変更Cashier User Changes

Laravel Cashierで使用されていたトレイトとインターフェイスの名前が変更されました。BillableTraitの代わりに、Laravel\Cashier\Billableトレイトを使用してください。それとLarave\Cashier\BillableInterfaceの代わりに、Laravel\Cashier\Contracts\Billableインターフェイスを実装します。他の名前の変更はありません。The name of the trait and interface used by Laravel Cashier[/docs/{{version}}/billing] has changed. Instead of using BillableTrait, use the Laravel\Cashier\Billable trait. And, instead of Laravel\Cashier\BillableInterface implement the Laravel\Cashier\Contracts\Billable interface instead. No other method changes are required.

ArtisanコマンドArtisan Commands

古いapp/commandsディレクトリからコマンドクラスを全部、新しいapp/Console/Commandsディレクトリへ移動します。次に、composer.jsonファイルのclassmapディレクティブに、app/Console/Commandsを追加します。Move all of your command classes from your old app/commands directory to the new app/Console/Commands directory. Next, add the app/Console/Commands directory to the classmap directive of your composer.json file.

Then, copy your list of Artisan commands from start/artisan.php into the commands array of the app/Console/Kernel.php file.Then, copy your list of Artisan commands from start/artisan.php into the commands array of the app/Console/Kernel.php file.

データベースマイグレーションと初期値設定Database Migrations & Seeds

データベースにusersテーブルが既に存在しているでしょうから、Laravel5.0に含まれている2つのマイグレーションを削除します。Delete the two migrations included with Laravel 5.0, since you should already have the users table in your database.

app/database/migrationsディレクトリのマイグレートクラスを、新しいdatabase/migrationsへ移動します。初期値設定(seed)クラスをapp/database/seedsから、database/seedsへ移動します。Move all of your migration classes from the old app/database/migrations directory to the new database/migrations. All of your seeds should be moved from app/database/seeds to database/seeds.

グローバルIoC結合Global IoC Bindings

start/global.phpの中のIoC結合は全て、app/Providers/AppServiceProvider.phpファイルのregisterメソッドへ移動します。Appファサードをインポートする必要があります。If you have any service container[/docs/{{version}}/container] bindings in start/global.php, move them all to the register method of the app/Providers/AppServiceProvider.php file. You may need to import the App facade.

そうした結合定義をカテゴリー毎に別々のサービスプロバイダへ分割する選択肢もあります。Optionally, you may break these bindings up into separate service providers by category.

ビューViews

app/views中のビューを新しいresources/viewsディレクトリへ移動します。Move your views from app/views to the new resources/views directory.

Bladeタグ変更Blade Tag Changes

デフォルトでもセキュリティーを強化するために、Laravel5.0では{{ }}{{{ }}}の両Blade記法で出力がエスケープされます。新しい{!! !!}記法により、出力をエスケープせずにそのまま表示します。アプリケーションをアップデートする場合の一番安全な選択肢は、明らかにそのまま出力をしても安全なところでだけで、新しい{!! !!}記法を使うことでしょう。For better security by default, Laravel 5.0 escapes all output from both the {{ }} and {{{ }}} Blade directives. A new {!! !!} directive has been introduced to display raw, unescaped output. The most secure option when upgrading your application is to only use the new {!! !!} directive when you are certain that it is safe to display raw output.

しかし、古いBlade記法を使わなくてはならないのでしたら、AppServiceProvider@registerの最後に、以下の数行を追加してください。However, if you must use the old Blade syntax, add the following lines at the bottom of AppServiceProvider@register:

\Blade::setRawTags('{{', '}}');
\Blade::setContentTags('{{{', '}}}');
\Blade::setEscapedContentTags('{{{', '}}}');

これは気軽に行うべきではありません。XSS攻撃に対しアプリケーションを脆弱にしてしまうかもしれません。また、{{--を使用したコメントは廃止されました。This should not be done lightly, and may make your application more vulnerable to XSS exploits. Also, comments with {{-- will no longer work.

言語ファイルTranslation Files

app/lang下の言語ファイルは、新しいresources/langディレクトリへ移動します。Move your language files from app/lang to the new resources/lang directory.

PublicディレクトリPublic Directory

4.2アプリケーションのpublicディレクトリから、公開しているアセットを新しいアプリケーションのpublicディレクトリへコピーします。5.0バージョンのindex.phpは変更しないように気をつけてください。Copy your application's public assets from your 4.2 application's public directory to your new application's public directory. Be sure to keep the 5.0 version of index.php.

テストTests

app/testsからテストを、新しいtestsディレクトリへ移動します。Move your tests from app/tests to the new tests directory.

その他のファイルMisc. Files

プロジェクトの他のファイルをコピーしましょう。例えば、.scrutinizer.ymlbower.json、その他の似たようなツールの設定ファイルなどです。Copy in any other files in your project. For example, .scrutinizer.yml, bower.json and other similar tooling configuration files.

SassやLess、CoffeeScriptをお好きな場所へ移動しましょう。resources/assetsディレクトリがデフォルトの場所として最適でしょう。You may move your Sass, Less, or CoffeeScript to any location you wish. The resources/assets directory could be a good default location.

FormとHTMLヘルパForm & HTML Helpers

FormかHTMLヘルパを使用している場合、class 'Form' not foundclass 'Html' not foundのエラーになります。FormとHTMLヘルパはLaravel5.0には含まれなくなりました。しかし、Laravel Collectiveによりメンテナンスされているコミュニティー主体の代替パッケージが存在しています。If you're using Form or HTML helpers, you will see an error stating class 'Form' not found or class 'Html' not found. The Form and HTML helpers have been deprecated in Laravel 5.0; however, there are community-driven replacements such as those maintained by the Laravel Collective[http://laravelcollective.com/docs/{{version}}/html].

例えば、"laravelcollective/html": "~5.0"composer.jsonrequireセクションへ追加してください。For example, you may add "laravelcollective/html": "~5.0" to your composer.json file's require section.

それから、FormとHTMLファサードとサービスプロバイダを追加する必要があります。config/app.phpを編集し、providers配列に以下の行を追加します。You'll also need to add the Form and HTML facades and service provider. Edit config/app.php and add this line to the 'providers' array:

'Collective\Html\HtmlServiceProvider',

次に、aliases配列へ以下を追加します。Next, add these lines to the 'aliases' array:

'Form' => 'Collective\Html\FormFacade',
'Html' => 'Collective\Html\HtmlFacade',

キャッシュマネージャーCacheManager

Laravelのキャッシュでファサードを使用せず、Illuminate\Cache\CacheManagerをコードで注入している場合、代わりにIlluminate\Contracts\Cache\Repositoryを注入してください。If your application code was injecting Illuminate\Cache\CacheManager to get a non-Facade version of Laravel's cache, inject Illuminate\Contracts\Cache\Repository instead.

ペジネーションPagination

$paginator->links()の呼び出しを$paginator->render()へ変更してください。Replace any calls to $paginator->links() with $paginator->render().

$paginator->getFrom()$paginator->getTo()の呼び出しをそれぞれ$paginator->firstItem()$paginator->lastItem()へ置き換えてください。Replace any calls to $paginator->getFrom() and $paginator->getTo() with $paginator->firstItem() and $paginator->lastItem() respectively.

$paginator->getPerPage()$paginator->getCurrentPage()$paginator->getLastPage()$paginator->getTotal()の呼び出しから、"get"プレフィックスを取り除いてください。(例:$paginator->perPage()Remove the "get" prefix from calls to $paginator->getPerPage(), $paginator->getCurrentPage(), $paginator->getLastPage() and $paginator->getTotal() (e.g. $paginator->perPage()).

BeanstalkキューBeanstalk Queuing

Laravel5.0では、"pda/pheanstalk": "~2.1"の代わりに、"pda/pheanstalk": "~3.0"が必要になります。Laravel 5.0 now requires "pda/pheanstalk": "~3.0" instead of "pda/pheanstalk": "~2.1".

RemoteRemote

Remoteコンポーネントは廃止されました。The Remote component has been deprecated.

WorkbenchWorkbench

Workbenchコンポーネントは廃止されました。The Workbench component has been deprecated.

4.1から4.2へのアップグレードUpgrading To 4.2 From 4.1

PHP 5.4 PHP 5.4

Laravel4.2を動作させるにはPHP 5.4.0以上が必要です。Laravel 4.2 requires PHP 5.4.0 or greater.

暗号化のデフォルトEncryption Defaults

app/config/app.php設定ファイルに、新しいcipherオプションが追加されました。このオプションの値は、MCRYPT_RIJNDAEL_256にすべきでしょう。Add a new cipher option in your app/config/app.php configuration file. The value of this option should be MCRYPT_RIJNDAEL_256.

'cipher' => MCRYPT_RIJNDAEL_256

この設定は、Laravelの暗号機能により使用される、デフォルトcipherをコントロールするために使用されます。This setting may be used to control the default cipher used by the Laravel encryption facilities.

注意: Laravel4.2では、最も安全な暗号化であると考えられる、MCRYPT_RIJNDAEL_128 (AES)がデフォルトの暗号化です。cipherをMCRYPT_RIJNDAEL_256へ戻すことが必要になるのは、Laravel4.1以前のバージョンで暗号化されたクッキー/値を解読する場合です。Note: In Laravel 4.2, the default cipher is MCRYPT_RIJNDAEL_128 (AES), which is considered to be the most secure cipher. Changing the cipher back to MCRYPT_RIJNDAEL_256 is required to decrypt cookies/values that were encrypted in Laravel <= 4.1

ソフトデリートは、トレイトを使用するようになりましたSoft Deleting Models Now Use Traits

モデルのソフトデリートを使用している場合、softDeletesプロパティーは必要なくなりました。SoftDeletingTraitを次のように使用してください。If you are using soft deleting models, the softDeletes property has been removed. You must now use the SoftDeletingTrait like so:

use Illuminate\Database\Eloquent\SoftDeletingTrait;

class User extends Eloquent
{
    use SoftDeletingTrait;
}

それから、datesプロパティーにdeleted_atカラムを追記してください。You must also manually add the deleted_at column to your dates property:

class User extends Eloquent
{
    use SoftDeletingTrait;

    protected $dates = ['deleted_at'];
}

ソフトデリート操作のAPIは、今までと変わりありません。The API for all soft delete operations remains the same.

注意: SoftDeletingTraitは、ベースモデルで使用してはいけません。実際のモデルクラスで使用します。Note: The SoftDeletingTrait can not be applied on a base model. It must be used on an actual model class.

View/PaginationのEnvironmentクラスの名前変更View / Pagination Environment Renamed

もし、Illuminate\View\Environmentクラスか、Illuminate\Pagination\Environmentクラスを直接参照している場合、Illuminate\View\FactoryIlluminate\Pagination\Factoryを代わりに参照するように、コードを変更してください。この2つのクラスは、機能をより良く表すように名前が変更されました。If you are directly referencing the Illuminate\View\Environment class or Illuminate\Pagination\Environment class, update your code to reference Illuminate\View\Factory and Illuminate\Pagination\Factory instead. These two classes have been renamed to better reflect their function.

ペジネーションプレゼンテーターの引数追加Additional Parameter On Pagination Presenter

Illuminate\Pagination\Presenterクラスを拡張している場合、getPageLinkWrapper抽象メソッドに、rel引数を追加するように変更してください。If you are extending the Illuminate\Pagination\Presenter class, the abstract method getPageLinkWrapper signature has changed to add the rel argument:

abstract public function getPageLinkWrapper($url, $page, $rel = null);

Iron.Ioキューの暗号化Iron.Io Queue Encryption

Iron.ioキュードライバを使用している場合、新しいencryptオプションをキュー設定ファイルに追加する必要があります。If you are using the Iron.io queue driver, you will need to add a new encrypt option to your queue configuration file:

'encrypt' => true

4.1.x以下から4.1.29へのアップグレードUpgrading To 4.1.29 From <= 4.1.x

Laravel4.1.29では、全データベースドライバのカラムクオーティングが向上しました。Eloquentモデルにfillableを使用していない場合の、複数代入に関する脆弱性からアプリケーションを保護します。複数代入されるのを防ぐためにモデルにfillableプロパティを使用している場合には、アプリケーションに脆弱性はありません。しかし、guardedを使用し、ユーザがコントロールできる配列を"update"や"save”タイプの機能に渡しているのでしたら、複数代入のリスクにアプリケーションがさらされているため、4.1.29へすぐアップグレードすべきでしょう。Laravel 4.1.29 improves the column quoting for all database drivers. This protects your application from some mass assignment vulnerabilities when not using the fillable property on models. If you are using the fillable property on your models to protect against mass assignment, your application is not vulnerable. However, if you are using guarded and are passing a user controlled array into an "update" or "save" type function, you should upgrade to 4.1.29 immediately as your application may be at risk of mass assignment.

Laravel4.1.29へアップグレードするには、composer updateを実行するだけです。このリリースには、ソース修正が必要な変更は含まれていません。To upgrade to Laravel 4.1.29, simply composer update. No breaking changes are introduced in this release.

4.1.25以下から、4.1.26へのアップグレードUpgrading To 4.1.26 From <= 4.1.25

Laravel 4.1.26では、"Remember me"クッキーへのセキュリティーが強化されました。このアップデート以前は、Remeberクッキーが悪意のあるユーザによりハイジャックされ、本当のユーザがアカウントのパスワードをリセットしたり、ログアウトしたりしても、クッキーが長期に渡り有効なままにされてしまいました。Laravel 4.1.26 introduces security improvements for "remember me" cookies. Before this update, if a remember cookie was hijacked by another malicious user, the cookie would remain valid for a long period of time, even after the true owner of the account reset their password, logged out, etc.

今回の変更により、usersテーブル(もしくはユーザ管理を行うためのテーブル)へ、新しいremember_tokenカラムを追加する必要があります。この変更により、ユーザがアプリケーションにログインするたびに、真新しいトークンが割り当てられます。このトークンはユーザがアプリケーションからログアウトするたびに、再生成されます。この実装により、もしも"Remember me"クッキがーハイジャックされても、アプリケーションからログアウトすれば、そのクッキーは無効になります。This change requires the addition of a new remember_token column to your users (or equivalent) database table. After this change, a fresh token will be assigned to the user each time they login to your application. The token will also be refreshed when the user logs out of the application. The implications of this change are: if a "remember me" cookie is hijacked, simply logging out of the application will invalidate the cookie.

アップデート法Upgrade Path

最初に、新しいremember_token(null値可能なVARCHAR(100)かTEXTなど)カラムをusersテーブルに追加してください。First, add a new, nullable remember_token of VARCHAR(100), TEXT, or equivalent to your users table.

次に、Eloquent認証ドライバを使用しているのであれば、Userクラスへ以下の3クラスを追加してください。Next, if you are using the Eloquent authentication driver, update your User class with the following three methods:

public function getRememberToken()
{
    return $this->remember_token;
}

public function setRememberToken($value)
{
    $this->remember_token = $value;
}

public function getRememberTokenName()
{
    return 'remember_token';
}

注意: この変更により、現在使用中の"Remember me"セッションは無効となるため、全ユーザはアプリケーションへの再認証を強制されます。Note: All existing "remember me" sessions will be invalidated by this change, so all users will be forced to re-authenticate with your application.

パッケージメンテナーの方へPackage Maintainers

Illuminate\Auth\UserProviderInterfaceへ、新しいメソッドが2つ追加されました。実装のサンプルは、デフォルトドライバをご覧ください。Two new methods were added to the Illuminate\Auth\UserProviderInterface interface. Sample implementations may be found in the default drivers:

public function retrieveByToken($identifier, $token);

public function updateRememberToken(UserInterface $user, $token);

Illuminate\Auth\UserInterfaceにも、「アップデート法」で説明している、新しい3つのメソッドが追加されました。The Illuminate\Auth\UserInterface also received the three new methods described in the "Upgrade Path".

4.0から4.1へアップグレードUpgrading To 4.1 From 4.0

コンポーザ依存パッケージのアップグレードUpgrading Your Composer Dependency

アプリケーションをLaravel4.1へアップグレードするには、composer.jsonファイルの中のlaravel/frameworkのバージョンを4.1に変更します。To upgrade your application to Laravel 4.1, change your laravel/framework version to 4.1.* in your composer.json file.

ファイルの置き換えReplacing Files

public/index.phpファイルをリポジトリーのこのファイルで置き換えてください。Replace your public/index.php file with this fresh copy from the repository[https://github.com/laravel/laravel/blob/v4.1.0/public/index.php].

artisanファイルをリポジトリーのこのファイルで置き換えてください。Replace your artisan file with this fresh copy from the repository[https://github.com/laravel/laravel/blob/v4.1.0/artisan].

設定ファイルとオプションの追加Adding Configuration Files & Options

app/config/app.php設定ファイル中のaliasesproviders配列を更新します。変更する内容はこのファイルで確認して下さい。自分で追加したサービスプロバーダーとエイリアスを書き戻すのを忘れないで下さい。Update your aliases and providers arrays in your app/config/app.php configuration file. The updated values for these arrays can be found in this file[https://github.com/laravel/laravel/blob/v4.1.0/app/config/app.php]. Be sure to add your custom and package service providers / aliases back to the arrays.

新規にapp/config/remote.phpファイルをこのリポジトリーから取得し、追加して下さい。Add the new app/config/remote.php file from the repository[https://github.com/laravel/laravel/blob/v4.1.0/app/config/remote.php].

app/config/session.phpファイルへ新しいexpire_on_close設定オプションを追加して下さい。デフォルト値はfalseです。Add the new expire_on_close configuration option to your app/config/session.php file. The default value should be false.

app/config/queue.phpファイルへ新しいfailed設定セクションを追加して下さい。セクションのデフォルト値は以下の通りです。Add the new failed configuration section to your app/config/queue.php file. Here are the default values for the section:

'failed' => [
    'database' => 'mysql', 'table' => 'failed_jobs',
],

(オプション):app/config/view.phpファイル中のpagination設定オプションをpagination::slider-3に変更することもできます。(Optional) Update the pagination configuration option in your app/config/view.php file to pagination::slider-3.

コントローラーの更新Controller Updates

もし、app/controllers/BaseController.phpが頭のところでuse文を使用していたら、use Illuminate\Routing\Controllers\Controller;use Illuminate\Routing\Controller;へ変更して下さい。If app/controllers/BaseController.php has a use statement at the top, change use Illuminate\Routing\Controllers\Controller; to use Illuminate\Routing\Controller;.

パスワードリマインダーの更新Password Reminders Updates

パスワードリマインダーは自由度を増すために全体的に見なおされました。php artisan auth:reminders-controller Artisanコマンドを実行し、作成される新しいスタブコントローラーを調べてみて下さい。もしくは、更新されたドキュメントを読み、それに従ってアプリケーションを更新して下さい。Password reminders have been overhauled for greater flexibility. You may examine the new stub controller by running the php artisan auth:reminders-controller Artisan command. You may also browse the updated documentation[/docs/security#password-reminders-and-reset] and update your application accordingly.

app/lang/en/reminders.php言語ファイルをこちらの更新済みファイルに合わせて変更して下さい。Update your app/lang/en/reminders.php language file to match this updated file[https://github.com/laravel/laravel/blob/v4.1.0/app/lang/en/reminders.php].

環境決定の更新Environment Detection Updates

セキュリティーの観点から、アプリケーションの環境を決定するためにURLのドメインはもう使用されなくなりました。これらの値は簡単に偽装でき、リクエストの環境を変更する攻撃が可能です。コンピューターのホスト名を利用するように、環境決定コードを変更して下さい。(hostnameコマンドがMac、Linux、Windowsで使用できます。)For security reasons, URL domains may no longer be used to detect your application environment. These values are easily spoofable and allow attackers to modify the environment for a request. You should convert your environment detection to use machine host names (hostname command on Mac, Linux, and Windows).

ログファイルの単純化Simpler Log Files

今回よりLaravelは、app/storage/logs/laravel.logファイルのみを作成、使用するようになりました。しかし、この動作はapp/start/global.phpファイルで設定できるままになっています。Laravel now generates a single log file: app/storage/logs/laravel.log. However, you may still configure this behavior in your app/start/global.php file.

Trailing Slashリダイレクトの削除Removing Redirect Trailing Slash

bootstrap/start.phpファイルの中から、$app->redirectIfTrailingSlash()の呼び出しを削除して下さい。この機能はフレームワークに含まれている.htaccessファイルで処理されるようになったため、メソッドは必要なくなりました。In your bootstrap/start.php file, remove the call to $app->redirectIfTrailingSlash(). This method is no longer needed as this functionality is now handled by the .htaccess file included with the framework.

次に、Apacheの.htaccessファイルを最後のスラッシュを処理する新バージョンへ置き換えて下さい。Next, replace your Apache .htaccess file with this new one[https://github.com/laravel/laravel/blob/v4.1.0/public/.htaccess] that handles trailing slashes.

現在のルートへのアクセスCurrent Route Access

現在のルートへアクセスするには、Route::getCurrentRoute()の代わりに、Route::current()が使えるようになりました。The current route is now accessed via Route::current() instead of Route::getCurrentRoute().

Composerの更新Composer Update

以上の変更を行ったら、アプリケーションのコアファイルを更新するために、composer updateを実行して下さい!クラスのロードエラーになった場合は、updateコマンドを--no-scriptsオプションを付け、実行してみてください。ですから、composer update --no-scriptsと実行します。Once you have completed the changes above, you can run the composer update function to update your core application files! If you receive class load errors, try running the update command with the --no-scripts option enabled like so: composer update --no-scripts.

ワイルドカードイベントリスナWildcard Event Listeners

ワイルドカードイベントリスナは、ハンドラ関数の引数にイベントを渡さなくなりました。発行されたイベントを見つける必要がある場合は、Event::firing()を使用してください。The wildcard event listeners no longer append the event to your handler functions parameters. If you require finding the event that was fired you should use Event::firing().

章選択

設定

明暗テーマ
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に保存してある設定項目をすべて削除し、デフォルト状態へ戻します。

ヘッダー項目移動

キーボード操作