Laravel 7.16 Out

The Laravel team developed two new methods for v7.16 model visibility and released them with the latest features, fixes, and changes in the 7.x category.

Model makeVisibleIf and makeHiddenIf Method

@rennokkiHidesAttributes model feature contributed to two new methods:

// Hide home_lineups and away_lineups when $sportEvent->has_lineups === false
$sportEvent->makeHiddenIf(function ($sportEvent) {
return ! $sportEvent->has_lineups;
}, ['home_lineups', 'away_lineups']);
// Include home_lineups and away_lineups if $sportEvent->has_lineups === true
$sportEvent->makeVisibleIf(function ($sportEvent) {
return $sportEvent->has_lineups;
}, ['home_lineups', 'away_lineups']);

Protection Command for Model

Alex Miles , --guard contributed to a special protection ability through :

php artisan make:policy --guard=api

Add a Theme Property to Mailable Class

Bassel Hossam has contributed to a new Mailable::$theme feature that allows the user to change the theme and enable the correct reflection in queued jobs.

Release notes

Below you can see the full list of new features and updates and the difference between 7.15.0 and 7.16.0 on GitHub. Users are advised to update to later version 7.16.1, which includes the latest patch for version 7.16.x.

v7.16.0

Added

  • makeVisibleIfand makeHiddenIfMethods Illuminate\Database\Eloquent\Concerns\HidesAttributes# 33176 , 42383e4 )
  • make:policyAdded a custom protection option ( # 33210 , 13e3b65 )
  • Mailablethemeadded property Illuminate\Mail\Mailable# 33218 )

Updated

  Quote

KARABAY A, 2020 . Laravel 7.16 Out,

https://www.karabayyazilim.com/blog/php/framework/laravel/laravel-716-cikti-2020-06-18-003245

(Accessed June 18, 2020).


  Share this post

Comments (0)

Comment

Subscribe
Sign up for the email newsletter to be the first to know about my blog posts