神刀安全网

A look at what’s coming to Laravel 5.3

Laravel 5.3 is currently in development and with all new Laravel releases, new features are being teased out as they are added. Here is a quick look at some of these new features:

Eloquent Collections are cleanly serialized and re-pulled by queued jobs:

In 5.3, Eloquent collections are cleanly serialized and re-pulled by queued jobs, just like individual models are! pic.twitter.com/IZ5t118WNT

— Laravel (@laravelphp) May 31, 2016

Jacob Bennett tells us why this matters .

Queue console output changed to show the actual class names:

Cleaning Laravel queue console output so it shows actual class names instead of "CallQueuedHandler" for every job. :+1: pic.twitter.com/iYKAhTHaeU

— Taylor Otwell (@taylorotwell) June 1, 2016

Ability to customize simple pagination

Today in Laravel 5.3 development. Bringing back simple pagination customization via views. :angel: pic.twitter.com/Ir28svVGCA

— Taylor Otwell (@taylorotwell) June 1, 2016

First Or Create

Now firstOrCreate allows additional values to be passed to it . Example:

return User::firstOrCreate(['github_id', $githubUser->id], ['avatar' => $githubUser->avatar]); 

Query Builder will now return a Collection

Query builder previously always returned arrays and now it’s going to change to return a collection . This will keep results the same no matter how you pulling the data out:

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

Multiple Migration Paths

Now you can load your own migration paths from a service provider:

$this->loadMigrationsFrom('path/to/migrations/folder') 

For more on, Alex Bowers has an overview.

Laravel Echo

Laravel Echo is a new feature designed to be an improvement over the current event broadcasting system. See the Laracasts video for more information.

The list only covers some of the big changes, but Laravel 5.3 is shaping up to be a nice release. A specific release date hasn’t been announced, but it should be out either this month or next. Be sure and join theLaravel newsletter to get notified as soon as 5.3 is officially released.

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » A look at what’s coming to Laravel 5.3

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址