The latest version of Laravel 5.6, version 5.6.16, is officially available as of Monday with a couple of new features, including support for executing console commands using the class name.
Execute Commands with a Class Name
When you call a console command, you typically use the console command name to execute it programmatically:
Artisan::call('report:daily', [ 'Provider' => 1 ]);
Now with class support, you can call consoles by the name of the class:
Artisan::call(DailyReportCommand::class, [ 'Provider' => 1 ]);
View is now “macroable”, which means you can define custom methods via a service provider
boot() method just like many of the other services that ship with Laravel. You can learn more about it reading the source code of the Macroable trait in Laravel 5.6.
IAM Role Session Token
If you are using the Amazon Simple Email Service (SES) driver for email, you can now set an
AWS_SESSION_TOKEN in the configuration. If you are using an IAM role, sending an email will fail with an invalid session token error. You can pass the token as follows in your configuration:
return [ 'ses' => [ 'key' => env('AWS_ACCESS_KEY_ID'), 'secret' => env('AWS_SECRET_ACCESS_KEY'), 'token' => env('AWS_SESSION_TOKEN'), 'region' => env('AWS_REGION', 'eu-west-1'), ], ];
Here are the full release notes for Laravel 5.6.16:
- Support executing artisan commands using class names (#23764)
- Added database
- Support IAM role session token to be used with SES (#23766)
- Added displayable value to
RedisQueue::blockingPop()check when using PhpRedis (#23757)
Join the weekly newsletter and never miss out on new tips, tutorials, and more.
Sending a daily email with Laravel and Campaign Monitor
Here on Laravel News, we offer multiple ways of staying up to date with new content. Everything from auto-sharing to…
Going Deeper with Factories Through Factory States
I suspect that if you are familiar with Laravel that you might use factories and possibly even factory states in your…