My Blog Posts

Laravel 7.16 Released

Laravel 7.16 Released

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

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 the ability of special protection through :

php artisan make:policy --guard=api

Add a Theme Property to Mailable Class

Bassel Hossam contributed to a new Mailable::$theme feature that allows the user to change the theme and enable accurate reflection on 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.



  • makeVisibleIfAnd makeHiddenIfMethods Illuminate\Database\Eloquent\Concerns\HidesAttributes# 33176 , 42383e4 )
  • make:policyAdded a special protection option ( # 33210 , 13e3b65 )
  • Mailablethemefeature added Illuminate\Mail\Mailable# 33218 )


Share this article

Comments (0)