Limit Controller Tasks To The Minimum

Posted 4 years ago by Henri85

Jeffrey said in his video about Laravel 5.1:

Place the 'validate' en 'create' in the (Auth) Controller instead of Service class (e.g. Registrar in Laravel 5.0)

I believe that de controller has the following tasks:

  • Receive input (after validating by form request class)
  • Delegate to underlying (e.g. service / library / model) (or maybe command?)
  • Consolidate
  • Return output

Limiting controllers to tasks above improves the reusability, scalability en manageability

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.