Skip to content

Back-end: Current challenges

Our codebase has a lot of stale parts. We aware about them, just need some time to fix all these problems step by step. Consider improving such code whenever you touch it. Just one small step at the time.

Eloquent queries in Models

Consider using scopes or tappable scopes when it’s possible and meaningful.

Bad separation of concerns on some systems/modules

Ways to solve:

  1. Rely on interfaces, not implementations.
  2. Do communication between systems/modules using Events/Observers/Subscribers.

Fat controllers

Ways to solve:

  1. Consider moving domain logic to domain layer: Models, Actions.
  2. Consider moving view logic to Blade components.
  3. Consider using Form Requests.

God objects

Ways to solve:

  1. Use traits (e.g., move all course-related functionality from the Member model to CanUseCourses trait).
  2. Use strategy pattern and/or Actions.

Slow console commands

Move heavy logic to Queued Jobs.