Throughout this course, I've shown you many structural patterns: Form Requests, DTOs, Services, Actions, Pipelines, Jobs, Events, Listeners, Traits, and Helpers. That's a big toolbox.
But here's the thing: you don't need to use all of them in every project. In fact, reaching for a pattern when you don't need it is just as bad as putting everything in the Controller.
This lesson is about knowing when NOT to extract.
You Don't Need an Action for Simple CRUD
If your Controller method is just this:
public function store(StoreUserRequest $request){ $user = User::create($request->validated()); return redirect()->route('users.index');}
That's fine. You don't need a CreateUserAction class for this. The logic is two lines, it's clear, it's not reused anywhere. An Action class would add a file, an import, and indirection — for zero benefit.
Extract when there's a reason to extract:
- The logic is complex (more than a few lines)
- The logic is reused from multiple places
- The logic has side effects that need testing
Events Add Indirection — Use Them When You Need Decoupling
Events and Listeners are powerful, but they....