Laravel: WAY BETTER Exception handling in 10 minutes

Sdílet
Vložit
  • čas přidán 5. 09. 2024

Komentáře • 10

  • @mouhamaddiop1144
    @mouhamaddiop1144 Před rokem +1

    I absolutely love ❤ your videos, they hold immense value. Creating functional features is great, but ensuring they are developed in a way that facilitates easy maintenance is a whole different level.
    Thank you for your videos, and you truly deserve many more subscribers.

  • @alexismontilla8637
    @alexismontilla8637 Před 8 měsíci

    Excellent video! thank you!
    Could you centralize all the error logs in the same handler? and so when there is an exception monitor it either in a file or in a database.
    How do you manage the whole log system for a robust application?

  • @ridwanurrahim9736
    @ridwanurrahim9736 Před 8 měsíci

    excellent

  • @impulserr
    @impulserr Před 7 měsíci

    Nice!

  • @josermzte
    @josermzte Před rokem +1

    Comment for the algo

  • @spicynoodle7419
    @spicynoodle7419 Před rokem

    Yikes, switch(true) is such a nasty language feature. Pls avoid

    • @saaslaravel
      @saaslaravel  Před rokem

      I wish we had range matching like in rust but that's not the case unfortunately 😕

    • @gamenation9706
      @gamenation9706 Před 8 měsíci

      Could you suggest a better way to do it please ?

    • @spicynoodle7419
      @spicynoodle7419 Před 8 měsíci +1

      @@gamenation9706 There are if-else. If you have a defined enum to switch over, it's more clear and performant to first switch on the enum and inside the case statement do an additional if-else.
      If you somehow think if-else is ugly, there is the State Pattern. You can also take other architectural decisions ahead of time to make sure you have precomputed enum values that you could use in a match ($enum) statement without additional if-else.
      switch (true) or match (true) is a huge code smell. You're either trying to be too fancy or you're fixing problems that you shouldn't have in the first place.