Stelle das U0-Fundament mit CMS, Mitgliedern und Filament bereit.
Deploy Test / test (push) Successful in 2m25s
Deploy Test / deploy (push) Failing after 25s

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-11-15 08:32:14 +01:00
1 parent 89b35ac480
commit 2035c46edd
130 files changed
+18519 -50

No files matched your search

+41
View File
@@ -0,0 +1,41 @@
<?php
namespace App\Domain\Identity;
use App\Models\User;
use Illuminate\Support\Facades\DB;
use Illuminate\Validation\ValidationException;
class RegisterAccount
{
public function register(string $name, string $email, string $password, bool $adult): User
{
if (! $adult) {
throw ValidationException::withMessages([
'adult' => 'Die Plattform richtet sich an Erwachsene. Ein Konto setzt die Bestätigung voraus.',
]);
}
return DB::transaction(function () use ($name, $email, $password): User {
$party = Party::query()->create([
'type' => PartyType::Person,
'display_name' => $name,
]);
Profile::query()->create([
'party_id' => $party->id,
'display_name' => $name,
'visibility' => ['display_name' => 'private'],
]);
return User::query()->create([
'party_id' => $party->id,
'name' => $name,
'email' => $email,
'password' => $password,
'status' => AccountStatus::Aktiv,
'confirmed_adult_at' => now(),
]);
});
}
}