Simplify Laravel Fat Controller Code with Service Class | Laravel Refactoring

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

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

  • @lassestube
    @lassestube 8 месяцев назад +3

    I think it’s great. I’d use a data object with typed values, and pass to the service. Also I’d dependency inject service with type, and call it service, not event ;)

  • @komolchandradevnath5454
    @komolchandradevnath5454 Год назад +2

    Good work , Nice Code Review .

  • @CodeWithAbirOfficial
    @CodeWithAbirOfficial Год назад +2

    Awesome, thanks :)

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

    Awesome explanation! but how does your eyes survive with light mode? hahahahaa

  • @2gbeh
    @2gbeh 8 месяцев назад

    Nice done

  • @AndreaForlin
    @AndreaForlin Год назад +4

    Good work, but why not use dependency injection and inject EventService?

    • @laravelschool
      @laravelschool  Год назад +3

      Excellent.
      I intentionally skip the DI for someone to spot the point and show me the right direction. 👏

  • @truthzp
    @truthzp Год назад

    Good job.
    Did you intentionally omit "ccURL" and "CCFullAddress" in the "$event->fill()" method to trigger me to add this comment? :D
    And there's a good idea to create a DTO instead of passing "$r->all()".

    • @laravelschool
      @laravelschool  Год назад +1

      haha.
      Not really. I didn't think of it like this way.
      BTW, it's a very good point to consider DTO here. This would be an another way to make this code in more shape.
      Appreciated for your input. 👏