0

I am using Laravels normal authentication functionality with RegisterController and the default views that are included. I have modified the RegisterController@create method to create a related model called Home to the User. Although a Home can have several User relations.

After signup, the User automatically have a Home related to them. The user should now be able to invite new users to join their Home. All the logic around the invites are solved, but I was wondering what the best solution for registering the invited user is.

Currently I have created a InviteController with a acceptInvite method that registers the new User related to the existing Home. But I really want to reuse the RegisterController@create method instead of having to maintain two registration processes.

Any ideas?

rebellion
  • 6,628
  • 11
  • 48
  • 79
  • Why don't you just check the existence of an `invitation` param (or something like that) to decide if you need to create a new user with a brand new `Home` or create this new user and let it join the already created `Home`? – enbermudas Jan 09 '20 at 19:05

1 Answers1

0

Your question is not clear... The user you want to invite to HOME are they registered users? if yes

All you need is a many to many relationship using a pivot table.

If the user you want to add to HOME is a new user and not already register on your app, just send them a mail with link to your register page, and let then use the RegisterController@create

Hope this help:)

josoye24
  • 61
  • 6