The most powerful way to use Eloquent

แชร์
ฝัง
  • เผยแพร่เมื่อ 31 ม.ค. 2025

ความคิดเห็น • 29

  • @nexxai
    @nexxai 7 หลายเดือนก่อน +2

    Wow. This is awesome! It makes so much sense regarding consistency and I think I'm going to be spending some time over the next week bringing it into my latest side project. Thanks for doing this!

    •  7 หลายเดือนก่อน +1

      Let me know what you think!

  • @piter33
    @piter33 7 หลายเดือนก่อน +1

    Great idea, Mateus! I'll try it. I think this is worth a PR in Laravel 😉

    •  7 หลายเดือนก่อน +1

      The package came from a PR! :-) github.com/laravel/framework/pull/48914

  • @mahdibouguerzi
    @mahdibouguerzi 7 หลายเดือนก่อน

    Great video 👍 ! but what will i miss if i used DB::transaction ?

    •  6 หลายเดือนก่อน

      You’d have to save each “piece” of the aggregate as separate entities, individually

  • @neverything
    @neverything 7 หลายเดือนก่อน

    Great video Mateus, thanks for sharing

    •  7 หลายเดือนก่อน

      Glad you enjoyed it my friend!

  • @inspiway6424
    @inspiway6424 7 หลายเดือนก่อน

    Nice, I had no idea about that "persist" method. Thx!

    • @criley7755
      @criley7755 4 หลายเดือนก่อน +1

      It's not a native Laravel function, it's part of his own package that he mentions throughout this video.
      Laravel does have a "push" method which can save a model and its relationships at the same time.

  • @joshcirre
    @joshcirre 7 หลายเดือนก่อน

    This is awesome. Thanks for teaching me. :)

    •  7 หลายเดือนก่อน

      Thanks for watching my dude!

  • @DaviMartins99
    @DaviMartins99 7 หลายเดือนก่อน

    I wish that Taylor left you some feedback on why not merging this instead of just closing with the auto message, guess it was because it's pretty big change to the Eloquent-way of thinking.
    Great idea for a package nevertheless, can see myself pulling this if the right scenario comes up.

    •  7 หลายเดือนก่อน +3

      I think it was a fair response! Eloquent is very complex and it’s a critical piece, so I understand that changing how it behaves is complicated.

  • @gui1gear
    @gui1gear 6 หลายเดือนก่อน

    What shortcuts are you using in phpstorm with vim?

    •  6 หลายเดือนก่อน

      Mostly just jumping lines

    • @gui1gear
      @gui1gear 6 หลายเดือนก่อน

      Não fui bem claro kkk… Queria saber se você mudou os shortcut da ide, pois no meu phpstorm ele fica avisando que tá dando conflito de shortcuts por causa do plugin do vim.

    •  6 หลายเดือนก่อน

      @@gui1gear não mudei nada não, que tipo de shortcut vc tá falando? eu entro no normal mode e uso os comandos do vim normalmente

  • @bobbyiliev_
    @bobbyiliev_ 7 หลายเดือนก่อน

    Great video! Well done!

    •  7 หลายเดือนก่อน

      Glad you liked it Bobby!

  • @the-code-reviewer
    @the-code-reviewer 7 หลายเดือนก่อน +1

    Great Doctrine idea :)

  • @gAAAia
    @gAAAia 4 หลายเดือนก่อน

    Amazing !!!!!! Foultzz

  • @LileshJadav
    @LileshJadav 7 หลายเดือนก่อน

    How about increased memory Usage? Because most developers don’t think about optimisation.

    •  6 หลายเดือนก่อน

      Memory usage would be the same as persisting each model individually.

  • @Ruggie1of1
    @Ruggie1of1 7 หลายเดือนก่อน +2

    push() exists on models already and is intended to save the model and relationships. (still a good idea to call it inside of a transaction)

    •  7 หลายเดือนก่อน +2

      Sadly it doesn’t always work - push assumes that models have been persisted already. See: github.com/laravel/framework/issues/48914

  • @vladvasilov
    @vladvasilov 7 หลายเดือนก่อน

    nice! This is somehow similar to MikroORM persist

    •  7 หลายเดือนก่อน

      Oh cool! I’ll check it out.

  • @florisvandenberg7424
    @florisvandenberg7424 4 หลายเดือนก่อน

    This is basically the datamapper pattern inside the activerecord pattern. Horrible. I really, really, really, really hate Eloquent and Laravel as a whole.