The Ergodnc code review is live
Reviewing Ergodnc is a new free code review on Codyssey, in six parts. Ergodnc is the office-rental API Mohamed Said built live on the official Laravel YouTube channel. Hosts list offices, guests reserve them by the day, and admins approve new offices. The review reads themsaid/ergodnc at commit 42907c0, which runs Laravel 8.
Why this codebase
Ergodnc is clean by the standards I see applied in most Laravel codebases I review. Its controllers are short, its output goes through API resources, and six of its seven write endpoints have feature tests. I audit it against a fixed rulebook that I apply to every Laravel codebase I want to keep for the long term. Against that rulebook, it breaks the same rules across its controllers.
What's inside
The hub, Reviewing Ergodnc - What a Clean Laravel API Still Gets Wrong, covers three things: what Ergodnc gets right, the problems that show up in every flow, and the module map the rebuild uses. The map splits the app into Offices, Reservations, and Identity modules that reach each other only through interfaces.
Five reviews each take one flow, show the current code, list what's wrong with it, and rebuild it as a vertical slice on Laravel 13:
- Moving Business Logic Out of a Laravel Controller:
POST /reservations. The price moves into a value object, the guards move onto the model, and the notifications move into a listener. - Putting the Ownership Check Inside the Lookup:
DELETE /reservations/{id}. One 422 for three different failures becomes a 403 and two 409s. - From a Hand-Rolled Validator to Form Requests: submitting and revising an office. Two Form Requests replace one validator, and the re-approval rule moves onto the model.
- Turning Validation Errors Into Domain Exceptions: deleting an office and its images. Business rules that returned 422 become exceptions that render their own 409, and file deletion moves into a queued listener.
- Query Handlers for Laravel List Endpoints: the office, guest, and host listings. Visibility is decided from the authenticated user, and the host listing gets the auth middleware it was missing.
The reviews are marked advanced. They're written for Laravel developers who already use Form Requests, Eloquent, and queued listeners.
Free content keeps coming
Insights and quick tips stay free to read, and new free courses, learning paths, code reviews, insights, quick tips and projects keep being released alongside the paid catalogue.
Follow along
New content is announced on X, Bluesky, LinkedIn, Facebook, Instagram, as well as the newsletter as it publishes.