Laravel version 5.6.19 was released yesterday with support for multiple CC, BCC, and Reply-To recipients. Also, the Optional class now implements the
__isset() magic method.
The Optional class now implements the magic method
__isset(). In the issue, the PR references this example of why
__isset() is needed for optional:
$user = User::find(1); $hasPhoneNumber = !empty(optional($user->contacts->first())->cellphone);
Because Optional did not support
$hasPhoneNumber variable in the example above will always be
__isset() method is triggered by calling
empty() in inaccessible object properties.
Support for a custom SparkPost endpoint means that you can now configure the endpoint in the
config/services.php configuration file:
'sparkpost' => [ 'secret' => env('SPARKPOST_SECRET'), 'options' => [ 'endpoint' => env('SPARKPOST_ENDPOINT'); ] ],
endpoint option isn’t set or is null, the configuration uses the default endpoint (
The last new feature is the ability to define multiple CC, BCC, and Reply-To recipients on mail notifications. These abilities were already possible on mailables, and are now possible on mail notifications.
Additionally, two new fixes ship as part of the 5.6.19 release. Here are the full release notes:
- Added support for custom SparkPost endpoint (#23910)
- Added support for multiple cc, bcc and reply-to recipients on mail notifications (#23760)