Paid memberships for Craft users through Laravel Cashier — plans map to user groups, Stripe handles the money.
justinholtweb/craft-velvetrope is a Laravel package for paid memberships for craft users through laravel cashier — plans map to user groups, stripe handles the money..
It currently has 1 GitHub stars and 0 downloads on Packagist (latest version 6.0.0-beta.2).
Install it with composer require justinholtweb/craft-velvetrope.
Discover more Laravel packages by justinholtweb
or browse all Laravel packages to compare alternatives.
Last updated
Paid memberships for Craft users through Laravel Cashier — plans map to user groups, Stripe handles the money.
[!WARNING] Craft 6 only, and in beta. Velvet Rope is a native Craft CMS 6 plugin. Craft 6 is still in beta, and so is Velvet Rope (
6.0.0-beta.1). It takes payments, so use caution on production: run every flow in Stripe test mode first, keep backups, and expect changes between betas. It does not run on Craft 5.
Docs: justinholt.com/plugins/craft-velvetrope (and docs/). See PLAN.md.
.env: STRIPE_KEY, STRIPE_SECRET, STRIPE_WEBHOOK_SECRET (the settings point at them by default).https://your-site/stripe/webhook sending customer.subscription.*,
checkout.session.completed and checkout.session.async_payment_succeeded. Webhooks are refused until
the signing secret is set — Cashier alone would accept unsigned ones.{{ velvetRope.checkoutUrl('gold') }}; gate pages with {% requireMembership 'gold' %}.craft:velvetrope:sync runs hourly so grace periods and gifts end on time.Members are in a plan's group while Stripe says they're paid up (active, trialing, cancelled-but-paid-to-period-end, or past due within the grace period) and out of it otherwise. Groups Velvet Rope doesn't manage are never touched. Deleting a Craft user cancels their Stripe subscriptions.
One API, the same rules in every engine (both call JustinHoltWeb\VelvetRope\VelvetRope).
| | Twig | Blade |
|---|---|---|
| Is a member (any plan) | {% if velvetRope.subscribed() %} | @subscribed … @endsubscribed |
| Has a plan | {% if velvetRope.subscribed('gold') %} | @subscribed('gold') … @else … @endsubscribed |
| Plan status | velvetRope.subscription('gold').status | $velvetRope->subscription('gold')['status'] |
| Gate a page | {% requireMembership 'gold' %} | @requireMembership('gold') |
| Links | velvetRope.checkoutUrl('gold'), velvetRope.billingUrl() | $velvetRope->checkoutUrl('gold'), $velvetRope->billingUrl() |
| Pro: gifts | velvetRope.giftOptions(), velvetRope.giftUrl('gold-year'), velvetRope.redeemUrl() | $velvetRope->giftOptions(), … |
Gates fail closed (an unset variable or unknown plan lets nobody in). App routes: ->middleware(['craft', 'craft.web', 'member:gold']).
Full reference: docs/templates.md.
People who aren't logged in can check out; when Stripe confirms payment, Velvet Rope creates a pending account for the email they paid with and sends Craft's activation email — nobody can sign in until that inbox sets a password — or adds the membership to the existing account with that email. Paying never signs anyone in. If that account is already a different Stripe customer, nothing is attached and the checkout is held for review. See docs/checkout.md.
Several plans at once · promotion codes (Checkout's box, or ?promo=CODE links) · dunning emails (failed payment,
grace ending, access ended — editable per language in System Messages) · gift memberships (one-time payment →
emailed code → redeem; only a hash is stored) · complimentary access · plan gates on sections and URI patterns
(gated pages are sent private, no-store). Details: docs/pro.md.
velvetRopePlans (schema permission View membership plans): handle, translated name, trial days, checkout
link, Pro gift options. No price IDs, no members, and no "current user is subscribed" — a token identifies an
app, not the visitor. See docs/graphql.md.
Checkout returns to the site the visitor started on, in its language; guest accounts are affiliated with that
site; gift emails link that site's redeem page; plan names translate with the site category. docs/multisite.md.
Lite / Pro — prices TBD.
composer install
composer test # Pest
composer phpstan # Larastan level 6
composer check-cs # Pint
Live checks against the Craft 6 harness (~/Sites/plugin-testing-craft6, bin/plugin-wire craft-velvetrope --install):
tests/Harness/check.sh. It needs no Stripe account: webhooks are signed locally with the harness's secret, and
API calls go to a local Stripe mock (tests/Harness/stripe-mock-router.php) through the loopback-only
VELVETROPE_STRIPE_API_BASE=http://127.0.0.1:12111 in the harness .env (ignored in production). It also needs
the app route Route::middleware(['craft', 'craft.web', 'member:gold'])->get('vr/route-gated', fn () => 'ROUTE-SECRET');
in the harness routes/web.php. The multisite section runs when the velvetropefr site exists:
bin/harness-lock ddev artisan tinker --execute "require '/var/www/sites/craft-velvetrope/tests/Harness/multisite-fixtures.php';"
(remove it afterwards with multisite-cleanup.php, also under the lock).
Get paid by clients abroad
Wise gives you local bank details in several currencies and converts at the mid-market rate. Useful when your invoices are not in your own currency.
Try WiseNew Laravel packages worth a look, once a month. No spam, one-click unsubscribe.