7 Eloquent Performance Tips from YOU

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 พ.ย. 2024

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

  • @julienSibille
    @julienSibille 3 ปีที่แล้ว +15

    selecting columns on relationship can be done pretty much simple :
    ->with('categories:id,name')

  • @nnamenearinze6086
    @nnamenearinze6086 3 ปีที่แล้ว +2

    Big fan!
    Please don't ever stop making Laravel videos ♥️🙏🏽

  • @intipontt7490
    @intipontt7490 3 ปีที่แล้ว +5

    Yeah, memory and time depend on the server's configuration. I'm running php locally on a non-server machine so my times were higher. You can take the number of models/amounts of queries done as a metric but to measure out performance, you need to compare against your own baseline.

  • @Perffy
    @Perffy 3 ปีที่แล้ว +1

    Nice video again. That trick with the DB::table()->get() instead of the Mode::get() helped me to answer my question from yesterday :)

  • @سجاداسکندریان
    @سجاداسکندریان 3 ปีที่แล้ว

    Thank you for all the tutorials that Mizari helped me a lot in my work progress. Thank you very much

  • @hassanihsan7881
    @hassanihsan7881 3 ปีที่แล้ว +1

    thank you so.much for your efforts your vidoes are very heplfull

  • @karnankarnan516
    @karnankarnan516 3 ปีที่แล้ว

    your video is very very nice .and a lot of learning in your videos get it thank you so much sir.

  • @dennisrnnebk8085
    @dennisrnnebk8085 3 ปีที่แล้ว

    Thanks for this video - very good explanation. A question: How will Eloquent compete with raw SQL ? Is Eloquent having an effect on the databases' own uptimization in a good/bad way ?

    • @BsiennKhan
      @BsiennKhan 3 ปีที่แล้ว +2

      He already hinted about this explaining a pull request that used query builder, same thing as raw query.
      Raw query will always be performant and memory efficient than eloquent, Because models does many things in backend like firing events automatically, changing columns on runtime getter and setters. On top of this it returns collection instead of arrays, so yeah eloquent does a lot, and thats the plus point actually, it does alot of things that helps practically.

  • @GergelyCsermely
    @GergelyCsermely 3 ปีที่แล้ว

    Thanks

  • @nnamenearinze6086
    @nnamenearinze6086 3 ปีที่แล้ว

    Sir, would it be possible to make a multiple authentication guard setup with Laravel passport for API authentication.

  • @karnankarnan516
    @karnankarnan516 3 ปีที่แล้ว +2

    small request plz( laravel 8 google map event how to pic point for scartch code )

  • @ViperNerd
    @ViperNerd 3 ปีที่แล้ว

    Hi there,
    I got this one problem:
    Got Members table,day table and their pivot table
    The problem I'm facing is that I want to select all members that are not found in pivot (like to put members in select to add them to pivot and avoid getting already added members in that pivot in the select list)
    I usually solve it by getting the day::with('member) and members::all() and find diff with some loops but it takes so much resource any easier way to do that?

    • @LaravelDaily
      @LaravelDaily  3 ปีที่แล้ว +1

      Search for whereDoesntHave method in the docs or google

    • @LaravelDaily
      @LaravelDaily  3 ปีที่แล้ว +1

      Or maybe even just doesntHave()

    • @ViperNerd
      @ViperNerd 3 ปีที่แล้ว

      Thanks very much...you are blessed

  • @isuruahinsa7185
    @isuruahinsa7185 3 ปีที่แล้ว

    ♥️

  • @maulikpatel3659
    @maulikpatel3659 3 ปีที่แล้ว +1

    could you please make video on websocket ?

    • @LaravelDaily
      @LaravelDaily  3 ปีที่แล้ว +1

      It's planned but later in 2021

  • @guilhermemoraes4055
    @guilhermemoraes4055 3 ปีที่แล้ว

    Do I have to create Service folder manually?

    • @LaravelDaily
      @LaravelDaily  3 ปีที่แล้ว +1

      Yes

    • @guilhermemoraes4055
      @guilhermemoraes4055 3 ปีที่แล้ว

      @@LaravelDaily Thank you. I have another question: Do you have any video teaching how to use external storage, like Google Drive, to upload files from Laravel project?

    • @LaravelDaily
      @LaravelDaily  3 ปีที่แล้ว +1

      Every external storage source is different. I don't have anything about Google drive, but I have something on Amazon s3, please search the channel

    • @guilhermemoraes4055
      @guilhermemoraes4055 3 ปีที่แล้ว

      @@LaravelDaily Will do. Thank you very much sir.

  • @L-A-O-S
    @L-A-O-S 3 ปีที่แล้ว

    Many people are faced with the problem of locking tables in queues through the database. How to avoid a race condition and get rid of the problem "Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction"?

    • @LaravelDaily
      @LaravelDaily  3 ปีที่แล้ว

      Googled and found a few articles, may be relevant: freek.dev/1087-breaking-laravels-firstorcreate-using-race-conditions

    • @L-A-O-S
      @L-A-O-S 3 ปีที่แล้ว

      @@LaravelDaily thx i will read this

  • @alex8vas
    @alex8vas 3 ปีที่แล้ว +1

    windows 7 php7.4 laravel 8.54 empty application without queries use 16Mb but same app on linux use ~5Mb

  • @Stoney_Eagle
    @Stoney_Eagle 3 ปีที่แล้ว +1

    You specifically specified that caching was not allowed, so featuring a pull request with caching is unfair to one who followed the rules.

    • @LaravelDaily
      @LaravelDaily  3 ปีที่แล้ว +6

      It's not about being fair or being featured, it's not a competition. It's about value to the audience, so mentioning such possible solution is value to the audience.

  • @belce1982
    @belce1982 3 ปีที่แล้ว

    Min. 7:46,
    ->with('category',fn($query) => $query->select('id','name'))
    Gives me a ParseError:
    syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting ')'

    • @LaravelDaily
      @LaravelDaily  3 ปีที่แล้ว +1

      Php 7.4+

    • @belce1982
      @belce1982 3 ปีที่แล้ว

      @@LaravelDaily Thanks!!!

  • @jpandagaming5995
    @jpandagaming5995 3 ปีที่แล้ว

    first