~/talk

Refactoring to SOLID in Laravel

Talkat Laracon EU 2022 · 2022-04-26..04-27· [php, frontend-architecture]
links:none on file
slides:none on file

Refactors a monolithic Livewire mortgage component into separate Blade pieces and plain PHP services, moving calculations and quoting out of the UI and into tested units. Extracts a calculate LTV service, a get product quotes service and a create product quote DTO, replaces DB-heavy tests with unit tests, uses Livewire events between form and search, and resolves flaky cases around LTV values like 75 80 and 79. Code is available on GitHub filmed at Laracon EU Amsterdam April 26 2022.

AI-written summary · about

  1. 0:00Introduction
  2. 3:21Laravel app example
  3. 7:57Monolithic component problems
  4. 10:25Extracting feature products
  5. 11:48Separating form and search
  6. 13:15Calculation service class
  7. 15:43DTOs for grouped data
  8. 16:25Product query service
  9. 18:12Product quote service
  10. 20:17Object composition principle
  11. 21:45Collections of DTOs
  12. 22:48Dependency inversion
  13. 23:53Guard clauses refactor
  14. 24:35Live Wire component final
  15. 25:38SOLID guidance
  16. 26:47Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.