Gates and catalog
Gates are the access unit in Klub. A gate is usually a provider price ID. Content is unlocked when the current user holds at least one of the gates attached to it.
Where gates come from
- Active subscriptions from the provider.
- One-time payments stored on the user.
- Manual gates stored in the user field defined by
ProviderGates::$field.
Plans and products
Plan and product sources depend on the provider. Stripe fetches plans/products from the Stripe API. Other built-in providers read plans from bnomei.klub.providers.{provider}.plans or, if empty, from site()->content()->plans YAML. Products are derived from those plans and grouped by product_id, product, or productname.
Using plans as gates
Use the built-in field fields/klub/gates/plans or define your own field that queries site.klub.plans.
translate: false
type: checkboxes
label: Gates Plans
columns: 4
options:
type: query
query: "site.klub.plans"
text: "{{ item.product.name }} {{ item.nickname }} [{{ item.unit_amount }}]"
value: "{{ item.id }}"
Using products as gates
Use the built-in field fields/klub/gates/products or query site.klub.products('one_time').
translate: false
type: checkboxes
label: Gates Products
columns: 4
options:
type: query
query: "site.klub.products('one_time')"
text: "{{ item.name }} {{ item.default_price.nickname }} [{{ item.unit_amount }}]"
value: "{{ item.default_price.id }}"
Manual gates
You can add manual gates on the user field defined by ProviderGates::$field. The default handler merges manual gates with provider subscriptions and payments.