18 Laravel/PHP Tips in 10 Minutes: June 2024

Поделиться
HTML-код
  • Опубликовано: 22 янв 2025

Комментарии • 28

  • @PabloZagni
    @PabloZagni 6 месяцев назад +6

    Yes! Please continue with monthly tips!

  • @mhm2314
    @mhm2314 6 месяцев назад +4

    Very good and efficient tips.
    Please continue this.

  • @dsuess
    @dsuess 6 месяцев назад +2

    This is a DARN GOOD tradition, thank you!

  • @WilliamWright-k8s
    @WilliamWright-k8s 6 месяцев назад +1

    i love this tips make me learn new things, most likely i will forget them again but i know where to come when need remember something

  • @MichalKuzmicki
    @MichalKuzmicki 6 месяцев назад +2

    The "tell, don't ask" example is more about two things: declarative programming; and a bit about separating the domain of the code - instead of creating some extended logic in the code, that is not the domain of the lessons (let's say a code for singing in, more about the participant, than the lesson itself), I prefer to create logic of the lesson in the lesson class/domain, and allow other domains to have minimal contact with this logic. Thanks to that when debugging such a code - you won't be surprised by an "alien" code.

  • @piyushgupta2128
    @piyushgupta2128 6 месяцев назад +1

    Great work sir 👍, please continue

  • @DoonSafari
    @DoonSafari 6 месяцев назад +1

    Yes Please. You are doing great work man❤

  • @HadilCharafeddine
    @HadilCharafeddine 5 месяцев назад

    amazing keep going! 🙏🏻

  • @rainfog_mzb
    @rainfog_mzb 6 месяцев назад +1

    1:32 Before using to_route(), I usually confuse (how to redirect with route) without looking documentation

  • @saravanasai2391
    @saravanasai2391 6 месяцев назад

    Wow, that is a great share. Hi chief, I would suggest you make a video related to event-sourcing in Laravel. What are the real-world use cases? A simple explanation that everyone can understand.

    • @LaravelDaily
      @LaravelDaily  6 месяцев назад

      I haven't used it myself, so can't explain to others :)

  • @TalesGrechi
    @TalesGrechi 6 месяцев назад

    These were great tips!

  • @franciscomagalhaes7457
    @franciscomagalhaes7457 6 месяцев назад

    This is helpful, thank you.

  • @holacuba2001
    @holacuba2001 6 месяцев назад

    Hello Povilas, would have a tip for a redirect with string data?
    Within a method I sometimes must redirect to another route, with a string value as parameter.
    The documentation says do this:
    return redirect()->route('profile', ['id' => 1]);
    and it works perfectly. Except that my parameter is a string and the URL looks ulgly because the paramater gets passed as a GET.
    Is there a fix for that?

    • @LaravelDaily
      @LaravelDaily  6 месяцев назад

      Not sure, maybe you defined the route the wrong way? I haven't encountered this issue.

    • @holacuba2001
      @holacuba2001 6 месяцев назад

      @@LaravelDaily Please try the eample from the book, but with a string parameter (a sentence). As I said, evrything works fine but the URL is ugly.

    • @LaravelDaily
      @LaravelDaily  6 месяцев назад

      Sorry, I don't have time to try, could you post the code of your profile route from the routes file?

    • @michalfrantisek
      @michalfrantisek 6 месяцев назад

      You must pass HTTP code parameter 307 - Temporary Redirect - to the redirect method.
      With 307 code you are able to redirect POST request.
      Please let me know if it helped you. Thanks.

  • @wgblondel
    @wgblondel 6 месяцев назад

    Thanks for the tips!

  • @_plamp_
    @_plamp_ 6 месяцев назад

    Awesome these are nice to know

  • @dsuess
    @dsuess 6 месяцев назад +1

    Thanks for re-posting passing variables to a View
    Tip: "Don't use Rails"

  • @JamesAutoDude
    @JamesAutoDude 6 месяцев назад

    Another thing is making utilities instead of helpers. Game changer 😮

    • @elmalleable
      @elmalleable 6 месяцев назад

      What's the difference?

  • @rakseiify
    @rakseiify 6 месяцев назад

    2:03 is this only obvious for those that have done a lot of PHP before doing Laravel?

  • @digitzero3613
    @digitzero3613 6 месяцев назад

    What's the point of disabling lazy loading? I though Laravel guys recommend it.

    • @LaravelDaily
      @LaravelDaily  6 месяцев назад +2

      Enforcing EAGER loading, to avoid N+1 query problem.

    • @digitzero3613
      @digitzero3613 6 месяцев назад +4

      @@LaravelDaily Ohh excuse me, I am so bad with these terms. I was actually thinking about eager loading but didn't realize that lazy loading is different. Thank you!