Assign the existing site to one landlord so stommer.info can run tenancy.

Seebad 0.3 stays in this release. With a single landlord every host still reaches the default website.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-10-23 12:00:11 +02:00
1 parent d9e52c4789
commit 8ebc1a3878
93 files changed
+2506 -112

No files matched your search

+34
View File
@@ -0,0 +1,34 @@
<?php
namespace App\Console\Commands;
use App\Models\User;
use Illuminate\Console\Attributes\Description;
use Illuminate\Console\Attributes\Signature;
use Illuminate\Console\Command;
#[Signature('users:promote-operator {email : E-Mail-Adresse}')]
#[Description('Grant the operator flag. The account keeps its password, two-factor setup and any landlord role.')]
class PromoteOperator extends Command
{
/**
* Execute the console command.
*/
public function handle(): int
{
$email = mb_strtolower(trim((string) $this->argument('email')));
$user = User::query()->where('email', $email)->first();
if ($user === null) {
$this->error('Kein Benutzer mit dieser E-Mail.');
return self::FAILURE;
}
$user->forceFill(['is_operator' => true])->save();
$this->info("{$email} ist jetzt Betreiber. Eine bestehende Mandanten-Rolle bleibt.");
return self::SUCCESS;
}
}