🆙 Forget data back 🆙

This commit is contained in:
Remco
2026-01-07 20:31:19 +01:00
parent acf2d7e661
commit 789b670f51
412 changed files with 66963 additions and 0 deletions
@@ -0,0 +1,27 @@
<?php
namespace App\Observers;
use App\Models\User;
class UserObserver
{
public function created(User $user): void
{
// We voegen haakjes toe zodat PHP 8.5 de volgorde begrijpt
$isHcEnabled = (setting('give_hc_on_register') ?: '0') === '1';
$user->settings()->create([
'last_hc_payday' => $isHcEnabled ? now()->addYears(10)->unix() : 0,
]);
if ($isHcEnabled) {
$user->hcSubscription()->insert([
'user_id' => $user->id,
'subscription_type' => 'HABBO_CLUB',
'timestamp_start' => now()->unix(),
'timestamp_expire' => now()->addYears(10)->unix(),
]);
}
}
}