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'); + }); + } +};