Installation
Require the package, then publish and run the migrations. The service provider is auto-discovered, and Composer pulls in the Roundly crypto, enums and money packages it builds on:
composer require roundly-consulting/purchases-for-laravel
php artisan vendor:publish --tag="purchases-migrations"
php artisan migrateThe migrations are publish-only — the package never auto-loads them, so a bare php artisan migrate creates nothing until you publish the purchases-migrations tag. Republishing overwrites the files in place instead of adding a second copy.
Config and routes
The config file is optional — every key has an env-backed default. Publish it to override, and publish the routes file only if you want to wire the bundled webhook route yourself:
php artisan vendor:publish --tag="purchases-config"
php artisan vendor:publish --tag="purchases-routes"Guided installer
purchases:install publishes the config and migrations and offers to run the migrations. With --providers it asks which providers you use and appends their env keys to .env:
php artisan purchases:install
php artisan purchases:install --providers # choose providers, append their .env keysUUID or ULID owners
Purchases and subscriptions belong to an owner through a nullable polymorphic owner column. If your owner models use UUID or ULID primary keys, set the key type before running the migrations — all owner models must share one key type. A value other than bigint, uuid or ulid throws an InvalidConfigurationException naming the key, so a typo fails the migration instead of keying the owner column wrong:
# Set before running the migrations when owners use UUID or ULID keys
PURCHASES_KEY_TYPE=uuidThe package exposes three publish tags: purchases-config, purchases-migrations and purchases-routes.
Show your open-source love
This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.
More ways to support, including cryptoBy donating, you agree to our donation terms.
Want this built into your product?
We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.