LoginSignup
69

More than 3 years have passed since last update.

【Laravel6リリース】Laravel 6 Is Now Released 日本語訳

Posted at

スクリーンショット 2019-09-04 9.35.02.png

Laravel6のリリースがあまり話題になっていない感じだったので、公式発表記事を日本語訳しました〜!

*こちらの記事はブログからの転載です。

イントロダクション

The Laravel team is proud to announce the release of Laravel 6 and it’s now available to everyone. This release marks the start of the Laravel framework (laravel/framework) using Semantic Versioning. Also, this release includes compatibility with Laravel Vapor, improved authorization responses, job middleware, lazy collections, sub-query improvements, among many other improvements.
Here are some of the new features included in Laravel 6:

LaravelチームはLaravel 6のリリースを発表。誰でも利用できるようになりました。

このリリースでは、セマンティックバージョニングを使用したLaravelフレームワーク(laravel / framework)が利用できます。

また、このリリースには、Laravel Vaporとの互換性、認可レスポンスの改善、ジョブミドルウェア、Lazy collection、サブクエリの改善、その他多くの改善が含まれています。

Laravel 6に含まれるいくつかの新機能は次のとおりです。

Laravel6.0はLTS!

The release of Laravel 6.0 marks the new LTS version of Laravel, with bugfixes until September 3rd, 2021 and security fixes until September 3rd, 2022. Laravel 5.5 was the previous LTS (with security fixes until August 30th, 2020). Here’s the updated table with versions and dates of the latest versions of Laravel:

Laravel 6.0のリリースは、Laravelの新たなLTSバージョンです。
以下が保証されています。

  • 2021年9月3日までのバグ修正
  • 2022年9月3日までのセキュリティ修正

以下がこれまでのLaravelのリリース表です。
スクリーンショット 2019-09-04 8.52.26.png

セマンティックバージョニング

The Laravel framework (laravel/framework) package now follows the semantic versioning standard. This makes the framework consistent with the other first-party Laravel packages which already followed this versioning standard. The Laravel release cycle will remain unchanged.

Laravelフレームワーク(laravel / framework)パッケージは、セマンティックバージョニング標準に準拠しています。

これにより、このバージョン管理標準に既に準拠している他のファーストパーティLaravelパッケージとフレームワークの一貫性が保たれます。

Laravelのリリースサイクルは変更されません。

セマンティック バージョニング(Semantic Versioning)とは、バージョン番号のつけ方に関する規約です。 いままでは各アプリケーションでバラバラなルールをもとにつけられていたバージョン番号でしたが、バージョン番号のつけ方に明確に意味を持たせ統一的なルールで番号をつけることによって、システム的に扱いやすくしようというものです。 省略して semver と呼びます。このセマンティック バージョニングに従ってバージョン番号をつけることによって、 新しいバージョンに上げてしまうとアプリケーションが動かなくなってしまうのか、それとも動作に影響がないのか、 バージョン番号からある程度判断することができるようになります。
引用:
[https://lazesoftware.com/blog/18/0405/:title]

認可レスポンスの改善 「Gate :: inspect」メソッド

Previously it was difficult to provide custom error messages around authorization to end users. Laravel 6 introduces a Gate::inspect method which provides the authorization policy’s response:
<<

以前は、エンドユーザーへの認証に関するカスタムエラーメッセージを提供することは困難でした。

Laravel 6では、承認ポリシーの応答を提供する「Gate :: inspect」メソッドが導入されています。

Gate::inspectの一例

$response = Gate::inspect('view', $flight);

if ($response->allowed()) {
    // User is authorized to view the flight...
}

if ($response->denied()) {
    echo $response->message();
}

Job Midlleware

Job Middleware
Job Middleware is a feature contributed by Taylor Otwell, which allows jobs to run through middleware:
<<
ジョブミドルウェアは、Taylor Otwell氏(Laravelを作った人)によって提供された機能であり、ミドルウェアを介してジョブを実行できます。

The middleware will help you avoid custom logic in the body of your job’s handle() method. Learn more in our post: Job Middleware is Coming to Laravel 6.
<<
ミドルウェアは、jobのhandle()メソッドの本体でカスタムロジックを回避するのに役立ちます。

詳細については、ポストをご覧ください:[https://laravel-news.com/job-middleware-is-coming-to-laravel-6:title=ジョブミドルウェアがLaravel 6に登場します。]

Job Middlewareの一例

// Add a middleware method to a job class
public function middleware()
{
     return [new SomeMiddleware];
}

// Specify middleware when dispatching a job
SomeJob::dispatch()->through([new SomeMiddleware]);

Lazy Collection

Lazy collections are a game-changer for working with extensive collections of data, including Eloquent model collections. A new Illuminate\Support\LazyCollection class leverages PHP’s generators to keep memory low while working with large datasets. Check out Lazy Collections documentation for more details on this impressive new feature!
<<

Lazy Collectionは、Eloquentモデルコレクションを含む広範なデータコレクションを操作するための画期的な製品です。

新しいIlluminate \ Support \ LazyCollectionクラスは、PHPのジェネレーターを活用して、大規模なデータセットを操作しながらメモリを低く抑えます。この新機能の詳細については、[https://laravel.com/docs/6.0/collections#lazy-collections:title=レイジーコレクションのドキュメント]をご覧ください!

Eloquent Subquery Enhancements

Learn more about Jonathan Reinink’s contributions to subqueries in his post on Laravel News – Eloquent Subquery Enhancements in Laravel 6.0. Also, check out Jonathan’s excellent talk on using subqueries (among other techniques) in his Laracon talk Eloquent Performance Patterns.
<<

Laravel 6.0の[https://laravel-news.com/eloquent-subquery-enhancements:title=Eloquent Subquery Enhancements]の投稿で、サブクエリに対するJonathan Reininkの貢献の詳細をご覧ください。

また、LaraconのトークEloquent Performance Patternsで、Jonathanのサ​​ブクエリの使用に関する(他の手法の中でも)優れた講演をご覧ください。

筆者注記

Eloquent Subquery Enhancementsとは、
- Selectサブクエリ
- OrderBy サブクエリ
- Fromサブクエリ
など、アプリケーションが消費するメモリ量の削減に特化したデータベース処理をより柔軟に行うためのサブクエリを指しているようです。

詳しくはこちらをご覧ください!
[https://laravel-news.com/eloquent-subquery-enhancements:title]

Laravel UI

The frontend scaffolding provided with Laravel 5.x releases is now extracted into a separate laravel/ui Composer package. This allows first-party UI scaffolding to be iterated on separately from the primary framework.
<<

Laravel 5.xリリースで提供されるフロントエンドのスキャフォールディングは、現在、独立したlaravel / ui Composerパッケージに抽出されています。

これにより、プライマリフレームワークとは別にファーストパーティUIのスキャフォールディングを反復処理できます。

If you want the Traditional Bootstrap/Vue/ scaffolding, you will run the following command:
<<
従来のBootstrap / Vue / scaffoldingが必要な場合は、次のコマンドを実行します。

composer require laravel/ui
php artisan ui vue --auth

Register as a new user and use Qiita more conveniently

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