V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
nonfu
V2EX  ›  PHP

Laravel 6.7.0 版本发布,支持显式不加载关联关系

  •  
  •   nonfu · 2019-12-13 16:49:53 +08:00 · 4176 次点击
    这是一个创建于 1589 天前的主题,其中的信息可能已经有所发展或是发生改变。

    Laravel 开发团队本周发布了 v6.7.0 版本,一个值得关注的更新是模型类支持调用 withoutRelations() 方法不加载关联关系,以提高性能,这在队列任务中序列化模型类时比较实用:

    /**
     * Create a new job instance.
     *
     * @param  \App\Podcast  $podcast
     * @return void
     */
    public function __construct(Podcast $podcast)
    {
        $this->podcast = $podcast->withoutRelations();
    }
    

    详细更新明细请阅读这篇文章:https://xueyuanjun.com/post/21332

    3 条回复    2019-12-16 15:19:13 +08:00
    agdhole
        1
    agdhole  
       2019-12-13 17:05:00 +08:00
    版本发布这个页面搞成时间 desc 更好点
    /books/laravel-new-feature/chapter/releases
    nonfu
        2
    nonfu  
    OP
       2019-12-13 22:14:31 +08:00
    @agdhole 感谢建议 这个后面优化下
    aijie
        3
    aijie  
       2019-12-16 15:19:13 +08:00
    网站进不去了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   920 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 20:48 · PVG 04:48 · LAX 13:48 · JFK 16:48
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.