You've already forked Epicnabbo-Catalogus-Updated-Daily
🆙 Added fixed cms
This commit is contained in:
@@ -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(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user