From 5c03f9cd11feaeecc1f99a75bff68eaab6bac3c5 Mon Sep 17 00:00:00 2001 From: Paulo Castellano Date: Thu, 14 May 2026 19:51:20 -0300 Subject: [PATCH] refactor(middleware): use Account::isOnTrial() instead of onGenericTrial() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Centralizes the 'is the user on any kind of trial?' question in the model. Equivalent behavior — Cashier's subscribed() already includes trialing subscriptions — but semantically cleaner and easier to extend. --- app/Http/Middleware/App/EnsureAccountReady.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Middleware/App/EnsureAccountReady.php b/app/Http/Middleware/App/EnsureAccountReady.php index f1dce5ff..4123ee71 100644 --- a/app/Http/Middleware/App/EnsureAccountReady.php +++ b/app/Http/Middleware/App/EnsureAccountReady.php @@ -27,7 +27,7 @@ public function handle(Request $request, Closure $next): Response if (! config('trypost.self_hosted')) { $hasAccess = $account && ( $account->subscribed(Account::SUBSCRIPTION_NAME) - || $account->onGenericTrial() + || $account->isOnTrial() ); if (! $hasAccess) {