[Laravel] 5.6.26がリリースされました
laravel/frameworkのバージョン5.6.26がリリースされました。更新された機能について確認していきます。
Added
1. Azure SQL Serverとのコネクションが切れた場合の挙動が改善されました (#24566)
php
public function routeNotificationForMail($notification)
{
return [
$this->email => $this->name,
];
}
// 複数の場合
public function routeNotificationForMail($notification)
{
return [
$this->email => $this->name,
$this->email_2,
$this->email_3 => $this->otherName,
];
}2. Notificationクラスでメールを送信する際に、受信者の名前を含めることが可能になりました (#24606)
モデルのリレーションから不必要な情報を削除できます。
php
$model->unsetRelation('user');3. Post-MigrationのafterCreate()メソッドのコールバックの引数にテーブル名が渡されるようになりました (#24621)
マイグレーション実行時にhookできます。
php
app('migration.creator')->afterCreate(function ($table) {
//
});4. Auth::attempt()メソッドに配列、Collectionを渡せるようになりました (#24620)
配列、Collectinを利用した認証例
php
Auth::attempt([
'email' => $request->get('email'),
'password' => $request->get('password'),
'user_type' => collect([1, 2, 3]),
'active' => 'Y'
], $request->get('remember'))詳しい変更については以下を確認してください。