Download the PHP package creem/laravel without Composer
On this page you can find all versions of the php package creem/laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download creem/laravel
More information about creem/laravel
Files in creem/laravel
Package laravel
Short Description Official Laravel package for CREEM - Accept payments globally with automatic tax handling
License MIT
Informations about the package laravel
CREEM for Laravel
The official Laravel package for CREEM — accept payments globally with automatic tax handling, subscription management, and license key distribution.
Features
- Facade API —
Creem::createCheckout(),Creem::getProduct(), and 24 methods total - Webhook handling — Automatic signature verification with typed Laravel events
- Billable trait — Add checkout, subscription, and billing portal to any Eloquent model
- Artisan commands —
creem:webhook-secret,creem:list-products - Full API coverage — Products, Checkouts, Subscriptions, Customers, Transactions, Licenses, Discounts
- Auto sandbox detection — Automatically routes to sandbox API when using test keys
- Laravel 10, 11 & 12 support with PHP 8.1+
Installation
Publish the configuration file:
Add your API credentials to .env:
Quick Start
Create a Checkout Session
Using the Billable Trait
Add the trait to your User model:
Run the migration to add the creem_customer_id column:
Now you can use billing methods directly on your User model:
API Reference
Checkouts
Products
Customers
Subscriptions
Transactions
Licenses
Discounts
Webhooks
CREEM webhooks are handled automatically. The package registers a POST route at /creem/webhook (configurable) and verifies signatures using HMAC-SHA256.
Setup
-
Set your webhook secret in
.env: - Register your webhook URL in the CREEM dashboard under Developers > Webhook:
Listening to Events
Register listeners in your EventServiceProvider or use Laravel's event discovery:
Create a listener:
Available Events
| Event Class | Webhook Type | Description |
|---|---|---|
CheckoutCompleted |
checkout.completed |
Payment successful, order created |
SubscriptionActive |
subscription.active |
New subscription created |
SubscriptionPaid |
subscription.paid |
Recurring payment processed |
SubscriptionCanceled |
subscription.canceled |
Subscription ended |
SubscriptionScheduledCancel |
subscription.scheduled_cancel |
Cancellation pending at period end |
SubscriptionPastDue |
subscription.past_due |
Payment failed, retrying |
SubscriptionExpired |
subscription.expired |
Period ended without payment |
SubscriptionTrialing |
subscription.trialing |
Trial period started |
SubscriptionPaused |
subscription.paused |
Subscription paused |
SubscriptionUpdated |
subscription.update |
Subscription modified |
RefundCreated |
refund.created |
Refund issued |
DisputeCreated |
dispute.created |
Chargeback opened |
Convenience Access Events
The package also dispatches AccessGranted and AccessRevoked events for simplified access management (inspired by the CREEM TypeScript SDK's onGrantAccess/onRevokeAccess pattern):
You can also listen to the generic CreemWebhookReceived event to catch all webhook types:
Artisan Commands
Generate Webhook Secret
List Products
Configuration
The config file (config/creem.php) supports these options:
| Option | Env Variable | Default | Description |
|---|---|---|---|
api_key |
CREEM_API_KEY |
'' |
Your CREEM API key |
webhook_secret |
CREEM_WEBHOOK_SECRET |
'' |
Webhook signing secret |
api_url |
CREEM_API_URL |
Auto-detected | Override the API base URL |
webhook_path |
CREEM_WEBHOOK_PATH |
creem/webhook |
Webhook route path |
currency |
CREEM_CURRENCY |
USD |
Default currency |
customer_model |
CREEM_CUSTOMER_MODEL |
App\Models\User |
Billable model class |
Sandbox vs Production
The package automatically detects sandbox mode based on your API key prefix:
creem_test_*→ Sandbox API (https://test-api.creem.io)creem_*→ Production API (https://api.creem.io)
Error Handling
The package throws typed exceptions for different error scenarios:
Demo App
Live Demo: https://creem.h90.space — see the package in action with real CREEM API integration.
A fully functional Docker-based demo app is included in examples/demo/. It demonstrates:
- Facade API calls (
Creem::searchProducts(),Creem::createProduct()) - Billable trait (
$user->checkout()) - Webhook event handling with live dashboard
- Sandbox/production auto-detection
- One-click sample product seeding via API
No products yet? Click ⚡ Create Sample Products on the products page or run:
See the demo README for full setup instructions.
Testing
Or run directly:
The package ships with 78 tests covering:
- API client HTTP handling & error responses
- All 24 Facade methods (checkout, products, subscriptions, discounts, etc.)
- Webhook signature verification
- Event dispatching for all 12 webhook types + AccessGranted/AccessRevoked
- Service provider bindings & configuration
- Artisan command registration & behavior
Package Structure
Requirements
- PHP 8.1+
- Laravel 10, 11, or 12
- Guzzle HTTP 7.0+
License
MIT License. See LICENSE for details.
Resources
Author
Built by Hani Amin — @HaniAmin90 · Discord: xh90
All versions of laravel with dependencies
illuminate/contracts Version ^10.0|^11.0|^12.0
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/http Version ^10.0|^11.0|^12.0
guzzlehttp/guzzle Version ^7.0