V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
nonfu
V2EX  ›  PHP

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

  •  
  •   nonfu · Dec 13, 2019 · 4993 views
    This topic created in 2329 days ago, the information mentioned may be changed or developed.

    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 replies    2019-12-16 15:19:13 +08:00
    agdhole
        1
    agdhole  
       Dec 13, 2019
    版本发布这个页面搞成时间 desc 更好点
    /books/laravel-new-feature/chapter/releases
    nonfu
        2
    nonfu  
    OP
       Dec 13, 2019
    @agdhole 感谢建议 这个后面优化下
    aijie
        3
    aijie  
       Dec 16, 2019
    网站进不去了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5798 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 44ms · UTC 02:25 · PVG 10:25 · LAX 19:25 · JFK 22:25
    ♥ Do have faith in what you're doing.