Deploy Ladill Events / deploy (push) Successful in 42s
Cut ticket checkouts off Ladill Pay, settle to merchant gateways at 0% platform fee, and mirror Invoice freemium pricing (GHS 49 / 149). Co-authored-by: Cursor <cursoragent@cursor.com>
25 lines
666 B
PHP
25 lines
666 B
PHP
<?php
|
|
|
|
namespace App\Http\Middleware;
|
|
|
|
use App\Services\Events\SubscriptionService;
|
|
use Closure;
|
|
use Illuminate\Http\Request;
|
|
use Symfony\Component\HttpFoundation\Response;
|
|
|
|
class EnsurePro
|
|
{
|
|
public function __construct(private readonly SubscriptionService $subscriptions) {}
|
|
|
|
public function handle(Request $request, Closure $next): Response
|
|
{
|
|
$user = ladill_account() ?? $request->user();
|
|
if ($user && $this->subscriptions->isPro($user)) {
|
|
return $next($request);
|
|
}
|
|
|
|
return redirect()->route('events.pro.index')
|
|
->with('upsell', 'This feature is part of Ladill Events Pro or Business.');
|
|
}
|
|
}
|