PHPackages                             devmohy/creem-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. devmohy/creem-laravel

ActiveLibrary[Framework](/categories/framework)

devmohy/creem-laravel
=====================

Official Laravel package for CREEM

v1.2.0(3mo ago)20MITPHPPHP ^8.1CI passing

Since Feb 10Pushed 3mo agoCompare

[ Source](https://github.com/devmohy/creem-laravel-package)[ Packagist](https://packagist.org/packages/devmohy/creem-laravel)[ RSS](/packages/devmohy-creem-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (6)Versions (4)Used By (0)

CREEM Laravel Package
=====================

[](#creem-laravel-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/4f239fcfe110d7f7fbc58b259846afc6a99a240ef11b8a99af1920fdf9928476/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6465766d6f68792f637265656d2d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/devmohy/creem-laravel)[![Total Downloads](https://camo.githubusercontent.com/08430d235a0a45f2a32eb2e5c86da632e3e9655c66a3fe619ec833035adb4915/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6465766d6f68792f637265656d2d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/devmohy/creem-laravel)[![License](https://camo.githubusercontent.com/8160d4bad676cb1210d952d6d11f81dd9739c4a05cca3194c54222631a295029/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6465766d6f68792f637265656d2d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/devmohy/creem-laravel)

Official Laravel package for [CREEM](https://creem.io), providing a clean, Laravel-native way to integrate payments, subscriptions, and webhooks.

Features
--------

[](#features)

- **Facade Support**: Simple API calls via `Creem::createCheckout()` and more.
- **Webhook Integration**: Middleware-protected webhook routing with automatic event dispatching.
- **Artisan Commands**: Easily manage your CREEM configuration and sync products.
- **SaaS Ready**: Designed for subscriptions and one-time payments.
- **CI/CD Ready**: Pre-configured GitHub Actions for automated testing.
- **Code Quality**: Built-in support for Laravel Pint to maintain clean code.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require devmohy/creem-laravel
```

You should publish the config file with:

```
php artisan vendor:publish --tag="creem-config"
```

This is the contents of the published config file:

```
return [
    'api_key' => env('CREEM_API_KEY'),
    'webhook_secret' => env('CREEM_WEBHOOK_SECRET'),
    'api_base_url' => env('CREEM_API_BASE_URL', 'https://api.creem.io/v1'),
];
```

Usage
-----

[](#usage)

### Create a Checkout Session

[](#create-a-checkout-session)

```
use Creem\CreemLaravel\Facades\Creem;

$response = Creem::createCheckout([
    'product_id' => 'prod_12345',
    'success_url' => route('checkout.success'),
    'cancel_url' => route('checkout.cancel'),
    'customer' => [
        'email' => 'user@example.com',
    ],
]);

if ($response->successful()) {
    $checkoutUrl = $response->json('checkout_url');
    return redirect($checkoutUrl);
}
```

### Get Product Details

[](#get-product-details)

```
$product = Creem::getProduct('prod_12345');
$allProducts = Creem::getProducts();
```

### Search Products

[](#search-products)

You can also search for products with detailed query parameters:

```
$products = Creem::searchProducts([
    'limit' => 10,
    'page' => 1,
    // other filters supported by CREEM API
]);
```

### Customer Management

[](#customer-management)

```
// Get a customer
$customer = Creem::getCustomer('cus_123');

// List customers
$customers = Creem::listCustomers([
    'page_size' => 10,
    'page_number' => 1,
]);

// Generate Billing Portal Link
$response = Creem::createPortalLink([
    'customer_id' => 'cus_123',
]);

return redirect($response->json('customer_portal_link'));
```

### Subscription Management

[](#subscription-management)

```
// Retrieve a subscription
$subscription = Creem::getSubscription('sub_123');

// Cancel a subscription
Creem::cancelSubscription('sub_123');

// Pause a subscription
Creem::pauseSubscription('sub_123');

// Update a subscription (e.g., change quantity)
Creem::updateSubscription('sub_123', [
    'items' => [
        ['id' => 'item_123', 'units' => 5]
    ]
]);

// Upgrade a subscription
Creem::upgradeSubscription('sub_123', [
    'product_id' => 'prod_premium',
    'update_behavior' => 'proration-charge-immediately',
]);
```

### Licenses

[](#licenses)

Manage software licenses directly from your application:

```
// Validate a license key
$license = Creem::validateLicense('ABC-123-XYZ', 'instance_unique_id');

if ($license->json('status') === 'active') {
    // Grant access
}

// Activate a license
Creem::activateLicense('ABC-123-XYZ', 'My Macbook Pro');

// Deactivate a license
Creem::deactivateLicense('ABC-123-XYZ', 'instance_unique_id');
```

### Transactions

[](#transactions)

```
// Get a transaction
$transaction = Creem::getTransaction('txn_123');

// List transactions
$transactions = Creem::listTransactions([
    'customer_id' => 'cus_123',
    'status' => 'succeeded',
]);
```

### Discounts &amp; Coupons

[](#discounts--coupons)

```
// Retrieve a discount by ID or Code
$discount = Creem::getDiscount('SAVE10');

// Create a discount
Creem::createDiscount([
    'name' => 'Black Friday',
    'code' => 'BF2024',
    'type' => 'percentage',
    'percentage' => 20,
    'duration' => 'once',
    'applies_to_products' => ['prod_123'],
]);

// Delete a discount
Creem::deleteDiscount('disc_123');
```

### Webhooks

[](#webhooks)

To handle webhooks, you can use the built-in controller or define your own route using the provided middleware.

#### Built-in Route (Optional)

[](#built-in-route-optional)

Add this to your `routes/api.php`:

```
Route::post('/creem/webhook', \Creem\CreemLaravel\Http\Controllers\WebhookController::class)
    ->middleware(\Creem\CreemLaravel\Http\Middleware\VerifyWebhookSignature::class);
```

#### Events

[](#events)

The package dispatches events when a webhook is received:

- `Creem\CreemLaravel\Events\WebhookReceived`
- `Creem\CreemLaravel\Events\CheckoutSucceeded`
- `Creem\CreemLaravel\Events\SubscriptionUpdated`

You can listen to these events in your `EventServiceProvider`:

```
protected $listen = [
    \Creem\CreemLaravel\Events\CheckoutSucceeded::class => [
        \App\Listeners\HandleSuccessfulPayment::class,
    ],
];
```

#### Example Listener

[](#example-listener)

Here is how you might implement a listener to handle a successful checkout:

```
namespace App\Listeners;

use Creem\CreemLaravel\Events\CheckoutSucceeded;
use Illuminate\Support\Facades\Log;

class HandleSuccessfulPayment
{
    public function handle(CheckoutSucceeded $event): void
    {
        $payload = $event->payload;
        $customerId = $payload['customer_id'] ?? null;

        Log::info("Payment received for customer: {$customerId}");

        // Grant access, update database, email user, etc.
    }
}
```

Commands
--------

[](#commands)

### Set Webhook Secret

[](#set-webhook-secret)

Generates or sets the `CREEM_WEBHOOK_SECRET` in your `.env` file.

```
php artisan creem:webhook-secret
```

### Sync/List Products

[](#synclist-products)

Fetches and displays all products from your CREEM dashboard.

```
php artisan creem:sync-products
```

Demo Application
----------------

[](#demo-application)

A fully functional demo application is included in the `demo/` directory, showcasing:

- **Pricing Page**: Displays products dynamically fetched from CREEM API
- **Checkout Flow**: Complete payment integration with CREEM
- **Customer Portal**: Subscription management interface
- **Webhook Handling**: Real-time event processing

### Running the Demo Locally

[](#running-the-demo-locally)

```
cd demo
composer install
cp .env.example .env
php artisan key:generate
php artisan serve
```

Visit `http://127.0.0.1:8000` to see the demo in action.

### Deploy Demo for Free

[](#deploy-demo-for-free)

The demo can be deployed to **Render.com** completely free! See [demo/DEPLOYMENT.md](demo/DEPLOYMENT.md) for step-by-step instructions.

**Live Demo**: \[Coming Soon\]

Testing
-------

[](#testing)

```
composer test
```

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Mohammed Yayah](https://github.com/devmohy)
- [CREEM](https://github.com/creem)

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Community
---------

[](#community)

- [Issue Tracker](https://github.com/devmohy/creem-laravel-package/issues)
- [Pull Requests](https://github.com/devmohy/creem-laravel-package/pulls)
- [Code of Conduct](CODE_OF_CONDUCT.md)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance82

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

97d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/176502f64afa1d77f208397aff7f81fad509ce3d088d84b3a8486a4df6b30c40?d=identicon)[devmohy](/maintainers/devmohy)

---

Top Contributors

[![devmohy](https://avatars.githubusercontent.com/u/21280968?v=4)](https://github.com/devmohy "devmohy (10 commits)")

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/devmohy-creem-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/devmohy-creem-laravel/health.svg)](https://phpackages.com/packages/devmohy-creem-laravel)
```

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k96.9M674](/packages/laravel-socialite)[laravel/slack-notification-channel

Slack Notification Channel for laravel.

89169.7M111](/packages/laravel-slack-notification-channel)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k25.9M107](/packages/laravel-cashier)[laravel/scout

Laravel Scout provides a driver based solution to searching your Eloquent models.

1.7k49.4M479](/packages/laravel-scout)[laravel/envoy

Elegant SSH tasks for PHP.

1.6k5.5M18](/packages/laravel-envoy)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

74310.9M66](/packages/laravel-mcp)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
