Readouble

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

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.

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';

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.

それから、start/artisan.phpでリストしていたArtisanコマンドをapp/Console/Kernel.phpcommand配列へコピーします。Then, copy your list of Artisan commands from start/artisan.php into the command 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!…]形式の挿入削除行の表示形式です。

テストコード表示
両コード表示
Pestのみ表示
PHPUnitのみ表示
和文変換

対象文字列と置換文字列を半角スペースで区切ってください。(最大5組各10文字まで)

本文フォント

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

コードフォント

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

保存内容リセット

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

ヘッダー項目移動

キーボード操作