You've got me all confused. What?
May 4, 2020
4
Level 3
Create a User and Team programmatically
I want to use the API to create a user programmatically. Since I use teams, I need to create a team as well and activate a billing plan. How can I do this? I couldn't find any documentation on this.
I found this info about seeding: https://gist.github.com/dillinghamio/fd32bd49b0176a085dc088f3bd2d01c7
So what I have so far is this:
$user = User::create([
'name' => $data['name'],
'email' => $data['email'],
'password' => Hash::make($data['password']),
]);
$team = Team::create([
'name' => $user->email,
'owner_id' => $user->id,
]);
$team->users()->attach($user, ['role' => 'owner']);
Is the freeTeamPlan activated by default? How can I apply a billing plan now?
Please or to participate in this conversation.