You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Terminate the billable's generic trial if it exists...
if (! is_null($user->trial_ends_at)) {
$user->update(['trial_ends_at' => null]);
}
}
However, unless trial_ends_at is included in the $fillable array of the billable model, this update will silently fail due to Laravel's mass assignment protection. This behavior is not documented, and developers may not realize that trial_ends_at needs to be included in $fillable for this update to succeed.
Expected Behavior
Laravel Cashier should update the trial_ends_at attribute successfully without requiring additional configuration or at least document this requirement.
Steps To Reproduce
My scenario:
The billable model is on a Team
Create a new trial for Team (without a payment method)
Create a subscription using Stripe Checkout
A new subscription starts but $team->onGenericTrial() still returns true
The text was updated successfully, but these errors were encountered:
Cashier Stripe Version
15.4
Laravel Version
11.9
PHP Version
8.3.9
Database Driver & Version
No response
Description
Hi there,
I believe I've encountered a potential bug related to how the
trial_ends_at
attribute is handled during webhook processing for subscription creation.Issue Description
In the
SubscriptionCreated
webhook handler, the following code attempts to set thetrial_ends_at
attribute tonull
:cashier-stripe/src/Http/Controllers/WebhookController.php
Lines 103 to 107 in 67f3625
However, unless
trial_ends_at
is included in the$fillable
array of the billable model, this update will silently fail due to Laravel's mass assignment protection. This behavior is not documented, and developers may not realize thattrial_ends_at
needs to be included in$fillable
for this update to succeed.Expected Behavior
trial_ends_at
attribute successfully without requiring additional configuration or at least document this requirement.Steps To Reproduce
My scenario:
Team
Team
(without a payment method)$team->onGenericTrial()
still returns trueThe text was updated successfully, but these errors were encountered: