Laravel 5.7.26 Released - Check New Features of Laravel 5.7

by jay patel




The Laravel team released Laravel 5.7.26 on 12 Feb 2019 with a new pipeline method and a method to temporarily bypass model events.

First, a new Pipeline method thenReturn was added by Tim MacDonald to allow additional work do be done on the object passed through:

 

// Priviously

$users  =  app ( Pipeline : : class )

->send ( User : : query ( ) )

->through ( $pipes )

->then ( function ( $query )  {

return  $query

->whereConfirmedEmail ( )

->whereAccountActive ( )

->get( ) ;

} ) ;

// As  of  5.7.26  you  can  use  ` thenReturn ( ) `

$users  =  app ( Pipeline : : class )

->send ( User : : query ( ) )

->through ( $pipes )

->thenReturn ( )

->whereConfirmedEmail ( )

->whereAccountActive ( )

->get ( ) ;

 

 

Next, a few public getter methods were added:

 

IlluminateCacheTaggedCache : : getTags ( ) ;

lluminateHttpResponseTrait : : getCallback ( ) ;

 

 

License files were added to each Illuminate components since Laravel uses subtree splits for all the components:

"Since we use a sub-split to split components into separate packages it’s wanted that we also provide a license file for each component.

Model::withoutEvents() method was added to temporarily bypass model events. A common use-case for this is testing:

 

$user = User :: withoutEvents ( function ( )  {

return  factory ( User :: class ) ->create ( ) ;

} ) ;

$user -> doSomethingWhereEventsShouldFire ( ) ;

 

 

You can see the full list of changes below, and the whole diff between 5.7.25 and 5.7.26 on GitHub.



Leave a Reply

Your email address will not be published. Required fields are marked *

   Confirm you are not a spammer
   Notify me of follow-up comments by email.