Added member and invitation endpoints

This commit is contained in:
Constantin Graf
2024-04-10 17:45:53 +02:00
parent 234fa06324
commit b67961cb07
48 changed files with 1186 additions and 106 deletions

View File

@@ -34,11 +34,19 @@ class CreateOrganization implements CreatesTeams
AddingTeam::dispatch($user);
/** @var Organization $organization */
$organization = $user->ownedTeams()->create([
'name' => $input['name'],
'personal_team' => false,
]);
$organization = new Organization();
$organization->name = $input['name'];
$organization->personal_team = false;
$organization->owner()->associate($user);
$organization->save();
$organization->users()->attach(
$user, [
'role' => 'owner',
]
);
$user->ownedTeams()->save($organization);
$user->switchTeam($organization);