Skip to content

Open-source social media scheduler built for AI agents and the teams behind them. Create, schedule and publish posts to every network through MCP or the REST API, or write them yourself in a composer your team will love.

feat(billing): surface generic trial state on billing settings + 7d default

Paulo Castellano83f9e69eede4
diff --git a/app/Http/Controllers/App/BillingController.php b/app/Http/Controllers/App/BillingController.php
index d955b6ea7..07eda9785 100644
--- a/app/Http/Controllers/App/BillingController.php
+++ b/app/Http/Controllers/App/BillingController.php
@@ -138,8 +138,8 @@ class BillingController extends Controller
return Inertia::render('settings/account/Billing', [
'hasSubscription' => $account->subscribed(Account::SUBSCRIPTION_NAME),
- 'onTrial' => $subscription?->onTrial() ?? false,
- 'trialEndsAt' => $subscription?->trial_ends_at,
+ 'onTrial' => $account->isOnTrial(),
+ 'trialEndsAt' => $subscription?->trial_ends_at ?? $account->trial_ends_at,
'subscription' => $subscription?->only([
'stripe_status',
'ends_at',
diff --git a/config/cashier.php b/config/cashier.php
index 44c302309..ed1ff73bd 100644
--- a/config/cashier.php
+++ b/config/cashier.php
@@ -135,6 +135,6 @@ return [
|
*/
- 'trial_days' => env('CASHIER_TRIAL_DAYS', 8),
+ 'trial_days' => env('CASHIER_TRIAL_DAYS', 7),
];
diff --git a/tests/Feature/Auth/TrialOnSignupTest.php b/tests/Feature/Auth/TrialOnSignupTest.php
index c3a7ebc20..f47434a06 100644
--- a/tests/Feature/Auth/TrialOnSignupTest.php
+++ b/tests/Feature/Auth/TrialOnSignupTest.php
@@ -27,7 +27,7 @@ test('new signup gets a 7-day trial without card', function () {
$starterPlan = Plan::where('slug', Slug::Starter)->firstOrFail();
expect($user->account->plan_id)->toBe($starterPlan->id);
- expect($user->account->trial_ends_at?->toDateTimeString())->toBe('2026-05-22 12:00:00');
+ expect($user->account->trial_ends_at?->toDateTimeString())->toBe('2026-05-21 12:00:00');
expect($user->account->stripe_id)->toBeNull();
});
@@ -57,7 +57,7 @@ test('account whose generic trial expired is not on trial', function () {
'registration_ip' => '127.0.0.1',
]);
- Carbon::setTestNow('2026-05-22 12:01:00');
+ Carbon::setTestNow('2026-05-21 12:01:00');
expect($user->account->fresh()->isOnTrial())->toBeFalse();
});
diff --git a/tests/Feature/Middleware/TrialMiddlewareAccessTest.php b/tests/Feature/Middleware/TrialMiddlewareAccessTest.php
index 1ecee9133..2f3f2b27f 100644
--- a/tests/Feature/Middleware/TrialMiddlewareAccessTest.php
+++ b/tests/Feature/Middleware/TrialMiddlewareAccessTest.php
@@ -54,7 +54,7 @@ test('user whose trial expired is redirected to subscribe', function () {
$workspace->members()->attach($user->id, ['role' => Role::Member->value]);
$user->update(['current_workspace_id' => $workspace->id]);
- Carbon::setTestNow('2026-05-22 12:01:00');
+ Carbon::setTestNow('2026-05-21 12:01:00');
$response = $this->actingAs($user->fresh())->get(route('app.accounts'));