[Laravel] 5.6.13がリリースされました

laravel/frameworkのバージョン5.6.13がリリースされました。更新された機能について確認していきます。

Added

1. view:cacheコマンドが追加されました (@9fd1273, @2ab8acf)

2. コレクションのmin()max()メソッドがショートコードによるアクセスが可能になりました (#23560)

以下のようにエイリアスとして利用できます。

$c->min('foo');
$c->max('foo');

// ショートコード
$c->min->foo;
$c->max->foo;

3. Bladeディレクテイブに@elseauth@elseguestが追加されました (#23569)

認証方法によって分岐ができるようになりました。

@auth('administrator')
@elseauth('standard')
@endauth

4. 暗号化のレベルを設定できるようになりました (#23573, @d6e3ca9)

以下のようにconfig/hashing.phpにてカスタマイズが可能になりました。

<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Default Hash Driver
    |--------------------------------------------------------------------------
    |
    | This option controls the default hash driver that will be used to hash
    | passwords for your application. By default, the bcrypt algorithm is
    | used; however, you remain free to modify this option if you wish.
    |
    | Supported: "bcrypt", "argon"
    |
    */

    'driver' => 'bcrypt',

    /*
    |--------------------------------------------------------------------------
    | Bcrypt Options
    |--------------------------------------------------------------------------
    |
    | Here you may specify the configuration options that should be used when
    | passwords are hashed using the Bcrypt algorithm. This will allow you
    | to control the amount of time it takes to hash the given password.
    |
    */

    'bcrypt' => [
        'rounds' => 10,
    ],

    /*
    |--------------------------------------------------------------------------
    | Argon Options
    |--------------------------------------------------------------------------
    |
    | Here you may specify the configuration options that should be used when
    | passwords are hashed using the Argon algorithm. These will allow you
    | to control the amount of time it takes to hash the given password.
    |
    */

    'argon' => [
        'memory' => 1024,
        'threads' => 2,
        'time' => 2,
    ],

];

5. タグ付けされたキャッシュキーのincrementdecrementが可能になりました (#23578)

6. SeeInOrderのテストが追加されました (#23594, @ca39449)

7. コレクションのgroupBy()メソッドがショートコードによるアクセスが可能になりました (#23608)

8. created_atの更新を無効化出来るようになりました (#23667)

CREATED_ATUPDATED_AT共にnullを指定することで日付の挿入をスキップ可能になりました。

class Model extends Eloquent
{
    public const CREATED_AT = null;

    public const UPDATED_AT = null;
}

9. optional()ヘルパーにコールバックが渡せるようになりました (#23688)

10. Eloquent\Collection::loadMorph()メソッドが追加されました (#23626)

morphリレーションのレコードについてもEager Loadingが可能になりました。

$activities = ActivityFeed::with('parentable')
    ->get()
    ->loadMorph('parentable', [
        Event::class => 'calendar',
        Photo::class => 'tags',
        Post::class => ['author', 'commentsCount'],
    ]);

詳しい変更については以下を確認してください。

Release v5.6.13 · laravel/framework · GitHub

© Xzxzyzyz