Add POS Pro subscription billing and free-tier limits.
Deploy Ladill POS / deploy (push) Successful in 43s
Deploy Ladill POS / deploy (push) Successful in 43s
Wallet-backed Pro unlocks unlimited products, restaurant mode, catalog imports, and ecosystem sync features. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -29,6 +29,8 @@ class ProductController extends Controller
|
||||
{
|
||||
use ScopesToAccount;
|
||||
|
||||
public function __construct(private readonly \App\Services\Pos\SubscriptionService $subscriptions) {}
|
||||
|
||||
public function index(Request $request): View
|
||||
{
|
||||
if ($this->isRestaurant($request)) {
|
||||
@@ -66,7 +68,15 @@ class ProductController extends Controller
|
||||
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
if ($this->isRestaurant($request)) {
|
||||
$user = ladill_account() ?? $request->user();
|
||||
$restaurant = $this->isRestaurant($request);
|
||||
|
||||
if (! $this->subscriptions->canAddProduct($user, $this->ownerRef($request), $restaurant)) {
|
||||
return redirect()->route('pos.pro.index')
|
||||
->with('upsell', 'You have reached the free plan limit of '.(int) config('pos.free.max_products', 50).' products. Upgrade to Pro for an unlimited catalog.');
|
||||
}
|
||||
|
||||
if ($restaurant) {
|
||||
$product = PosProduct::create([...$this->localValidated($request), 'owner_ref' => $this->ownerRef($request)]);
|
||||
$product->modifierGroups()->sync($this->groupIds($request));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user