From f1c1a1c5727cf22ed3f5b5eacaf287a664b720bf Mon Sep 17 00:00:00 2001 From: Ovidiu U Date: Thu, 23 Apr 2026 10:23:27 +0100 Subject: [PATCH] feat: add grace_period_until to users table --- app/Models/User.php | 3 ++- ..._add_grace_period_until_to_users_table.php | 23 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 database/migrations/2026_04_23_092253_add_grace_period_until_to_users_table.php diff --git a/app/Models/User.php b/app/Models/User.php index f42e9e3..5802c16 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -17,7 +17,7 @@ use Laravel\Cashier\Billable; use Laravel\Fortify\TwoFactorAuthenticatable; use Laravel\Sanctum\HasApiTokens; -#[Fillable(['name', 'email', 'email_verified_at', 'password', 'is_admin', 'postcode', 'preferred_fuel_type'])] +#[Fillable(['name', 'email', 'email_verified_at', 'password', 'is_admin', 'postcode', 'preferred_fuel_type', 'grace_period_until'])] #[Hidden(['password', 'two_factor_secret', 'two_factor_recovery_codes', 'remember_token'])] class User extends Authenticatable implements FilamentUser { @@ -35,6 +35,7 @@ class User extends Authenticatable implements FilamentUser 'email_verified_at' => 'datetime', 'password' => 'hashed', 'is_admin' => 'boolean', + 'grace_period_until' => 'datetime', ]; } diff --git a/database/migrations/2026_04_23_092253_add_grace_period_until_to_users_table.php b/database/migrations/2026_04_23_092253_add_grace_period_until_to_users_table.php new file mode 100644 index 0000000..4050476 --- /dev/null +++ b/database/migrations/2026_04_23_092253_add_grace_period_until_to_users_table.php @@ -0,0 +1,23 @@ +timestamp('grace_period_until')->nullable()->after('password') + ->comment('Set when invoice.payment_failed webhook fires; cleared on payment success or subscription deletion. Drives dashboard past-due banner.'); + }); + } + + public function down(): void + { + Schema::table('users', function (Blueprint $table) { + $table->dropColumn('grace_period_until'); + }); + } +};