What's new for the upcoming Laravel 5.3, let's take a peek

Source: Internet
Author: User
Lararavel5.3 is currently under development, and as with all new releases Laravel released, this version will add some new features and features, let's see the quick.

1, eloquent set as Queue task constructor parameter optimization

Laraval Queue tasks When distributing a eloquent model as a constructor parameter, we can use serializesmodels trait to serialize only the primary key of the model. When the queue task is actually processed, the full model instance is fetched from the database based on the primary key (refer to the queue document), and in Laravel 5.3, the eloquent collection can do the same.

2. The queue console output is modified to show the actual class name

3. Customize Simple Paging

4, Firstorcreate method to add additional parameters

The Firstorcreate method allows you to pass extra values as a second parameter:

return user::firstorcreate ([' github_id ', $githubUser->id], [' Avatar ' = ' $githubUser->avatar]);

5. Query Builder return type is set

The Query Builder returns an array in previous versions of Laravel, and returns a collection in Laravel 5.3, which guarantees consistency of the data output:

$collection = db::table (' posts ')->get ();

6. Multiple Migration paths

In Laravel 5.3 You can load your own migration (migration) path in service provider Provider:

$this->loadmigrationsfrom (' Path/to/migrations/folder ')

The benefit of this is that the extension package maintains its own database migration files without having to manually copy them to the Database/migrations directory each time.

7, Laravel Echo

Larval Echo is a new feature designed to enhance the Laravel existing Event Broadcast System (view existing event broadcast documents).

The above listed only some new features and new features, complete update will have to wait until the Laravel 5.3 version of the official release to know, should not wait too long, this month or next month will meet with you, pay attention to Laravel College, the college will be the first time to inform you and launch Laravel 5.3 Chinese documents.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.