refactor(middleware): use Account::isOnTrial() instead of onGenericTrial()

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.
This commit is contained in:
Paulo Castellano 2026-05-14 19:51:20 -03:00
parent 83f9e69eed
commit 5c03f9cd11

View file

@ -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) {