Utchin
5 months ago
1062
1
Spark

Create account when user registers

Posted 5 months ago by Utchin

Hi,

I want to simplify the process of a user creating a team, and as soon as they register it will create the team with the name from the sign up form.

I was going to an event listener on UserRegistration but not sure what code to put in there.

$test = Spark::call(
            TeamRepository::class . '@create',
            [$user, $data]
        );

This only creates the team, not the team_users too.

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