Josh Hanley - Building a maintainable Livewire application - Laracon AU 2023

Поделиться
HTML-код
  • Опубликовано: 11 июл 2024
  • Join Josh Hanley as he sails through ways to build a maintainable Livewire application while cruising Australia's east coast. Dive into topics like page components, naming conventions, and effective organisation.
    00:00 Components
    02:08 Page components
    03:32 Invokable components
    04:21 Naming conventions
    05:25 Organising components
    06:47 Computed properties
    10:19 Cached properties
    10:51 Component structure
    15:25 Form objects
    17:24 Action classes
  • НаукаНаука

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

  • @nym49
    @nym49 7 месяцев назад +7

    Is there more content like this?
    This is by far the hardest information to get to as someone that has progressed past the basics.

    • @_joshhanley
      @_joshhanley 7 месяцев назад +1

      I don't have anything at this stage, but would be open to putting more information out there. Do you have anything in particular you would like to learn about?

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

    Great tips!
    Biggest benefit imo of action classes (or any other business logic layer) is we can now reuse that logic in other parts of the system (API endpoints, Jobs, Commands, etc.). It's no longer tied down to the Livewire component itself.

    • @_joshhanley
      @_joshhanley 7 месяцев назад

      Thanks!
      Yep exactly! I love using them personally😁

  • @1234matthewjohnson
    @1234matthewjohnson 7 месяцев назад +2

    very insightful thanks mate!

    • @_joshhanley
      @_joshhanley 7 месяцев назад +1

      No worries! 🙂

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

    What I do instead of #Computed is just do the fetching in render() and pass it to view(). Is this a bad idea?

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

      Nope, that works fine. It's more of a traditional Laravel way to do things though, where as computed properties and public properties are more of a Livewire way to get data to the view as Livewire handles it for you.
      I personally don't like doing it that way, as I like to keep my render method clean.
      Using computed properties has the added bonus of memoisation and caching, plus they are easier to unit test than data called in the render method.

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

      @@joshuahanley32 I appreciate your insights! Thanks for taking the time to reply.
      I will keep those points in mind 👍🏻👍🏻

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

      @@joshuahanley32 I've experimented a bit with #[Computed] and I love it. Thanks! Slowly migrating components as I am working on them. Looks much cleaner.