Download the PHP package crumbls/subscriptions without Composer

On this page you can find all versions of the php package crumbls/subscriptions. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package subscriptions

Crumbls Subscriptions

A flexible plans and subscription management system for Laravel. Manage SaaS plans, features, and subscriber usage tracking without coupling to any payment provider.

Inspired by rinvex/laravel-subscriptions, which is now abandoned. This package modernizes the codebase for Laravel 11/12/13, PHP 8.3+, and current Laravel conventions.

Features

Requirements

Package PHP Laravel
2.x 8.3, 8.4 11.x, 12.x, 13.x

All combinations in the matrix above are exercised in CI on every push and pull request.

Installation

Publish config and migrations (optional):

Run migrations:

Migrations autoload by default. Set autoload_migrations to false in config/subscriptions.php to disable this.

Database Structure

Features are standalone entities. The value (limit) is set per-plan on the plan_features pivot. This lets a single "Users" feature have different limits across plans.

Usage

Add subscriptions to a model

Works on any Eloquent model — User, Tenant, Team, Organization, etc.

Create a plan

Intervals accept: hour, day, week, month, year.

Create features

Features are standalone — create them once, attach to many plans:

Attach features to plans with values

The value is set per-plan on the pivot — this is how different plans get different limits:

Factories

Every model ships with a factory for testing and seeding:

Subscribe

Subscription slugs are unique per subscriber, not globally, so both a User and a Tenant can hold a main subscription at the same time.

Check subscription status

Feature usage

If you call recordFeatureUsage with a slug that isn't attached to the subscription's plan, it throws Crumbls\Subscriptions\Exceptions\UnknownFeatureException — the featureSlug and plan are exposed as readonly properties on the exception.

Enforcing limits (example: user count)

Plan lifecycle

Scopes

Events

Event Fired when
SubscriptionCreated A new subscription is created
SubscriptionCanceled A subscription is canceled (includes $immediate flag)
SubscriptionRenewed A subscription is renewed
SubscriptionPlanChanged A subscription switches plans (includes $oldPlan and $newPlan)

These events are plain dispatchable events — they do not implement ShouldBroadcast out of the box. If you want a broadcast version, extend the event in your application and add implements ShouldBroadcast there.

Middleware

Gate routes by feature or subscription:

Pruning expired subscriptions

Schedule it:

Configuration

Publish the config to customize table names or swap model classes:

Extending models

Every model is resolved through config. Extend the base model and update the config:

All relationships, scopes, traits, middleware, and the prune command resolve models through config — your custom models are used everywhere automatically.

Models

Model Description
Plan A subscription plan with pricing, billing cycle, trial/grace periods
Feature A standalone feature (e.g. "Users", "API Calls", "SSL")
PlanFeature Pivot model linking features to plans with a value per plan
PlanSubscription A subscriber's subscription to a plan
PlanSubscriptionUsage Tracks how much of a feature a subscription has consumed

Considerations

Coming from rinvex/laravel-subscriptions

This package started as a modern reboot of rinvex/laravel-subscriptions, so the mental model is similar but a few things are worth knowing if you're porting an existing app:

Upgrading

See CHANGELOG.md.

Contributing

See CONTRIBUTING.md.

License

MIT


All versions of subscriptions with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/console Version ^11.0 || ^12.0 || ^13.0
illuminate/database Version ^11.0 || ^12.0 || ^13.0
illuminate/support Version ^11.0 || ^12.0 || ^13.0
spatie/eloquent-sortable Version ^4.4 || ^5.0
spatie/laravel-sluggable Version ^3.8
spatie/laravel-translatable Version ^6.13
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package crumbls/subscriptions contains the following files

Loading the files please wait ...