1 year ago

Creating model record in multiple locations

Posted 1 year ago by TxNuno

I am using a ConsultationController to create a Consultation record. I now want to be able to create a consultation record in my RegisterController. What is the best way to handle this?

A few options that come to mind:

  1. Add a method on the User model to handle this. $user->startConsultation()
  2. Use the Consultation::create() in all locations.

What is the best practice here? Which class should have the responsibility of creating a consultation?

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