PHPackages                             billkit-eu/billkit-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. [Payment Processing](/categories/payments)
4. /
5. billkit-eu/billkit-laravel

ActiveLibrary[Payment Processing](/categories/payments)

billkit-eu/billkit-laravel
==========================

First-class Laravel integration for BillKit: a Cashier-shaped billing layer on the BillKit API (Mollie-backed, EU).

v0.1.0(today)01↑2900%Apache-2.0PHPPHP &gt;=8.2CI failing

Since Aug 25Pushed todayCompare

[ Source](https://github.com/billkit-eu/billkit-laravel)[ Packagist](https://packagist.org/packages/billkit-eu/billkit-laravel)[ Docs](https://billkit.eu)[ RSS](/packages/billkit-eu-billkit-laravel/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (14)Versions (2)Used By (0)

BillKit for Laravel
===================

[](#billkit-for-laravel)

First-class Laravel integration for [BillKit](https://billkit.eu), a Cashier-shaped billing layer on top of the `billkit-eu/billkit-php` PHP SDK.

- A `Billable` trait for your `User`/`Team` model
- Hosted checkout (`$user->checkout(...)`) and per-subscription billing portal
- A webhook-synced `Subscription` Eloquent model + entitlement helpers
- Signature-verified webhook controller wired out of the box

BillKit provisions subscriptions from the inbound Mollie webhook (there is no synchronous "create subscription" call), so the flow is **checkout → redirect → your webhook creates the local `Subscription`**, exactly the Cashier model.

Install
-------

[](#install)

```
composer require billkit-eu/billkit-laravel
php artisan migrate      # creates billkit_subscriptions + adds billkit_customer_id
```

Publish the config if you want to tweak it:

```
php artisan vendor:publish --tag=billkit-config
```

Set your credentials in `.env`:

```
BILLKIT_API_KEY=sk_test_...
BILLKIT_WEBHOOK_SECRET=whsec_...
```

Make a model billable
---------------------

[](#make-a-model-billable)

```
use BillKit\Laravel\Billable;

class User extends Authenticatable
{
    use Billable;
}
```

Start a subscription (checkout)
-------------------------------

[](#start-a-subscription-checkout)

```
// In a controller. Checkout is Responsable, so you can return it directly:
return $request->user()->checkout('price_pro_monthly', [
    'success_url' => route('billing.done'),
    'cancel_url'  => route('pricing'),
    'trial_days'  => 14,        // optional per-checkout trial override
    'coupon_code' => 'LAUNCH',  // optional
]);
```

The buyer is redirected to the hosted Mollie checkout. When they finish, BillKit sends `subscription.created`; the package's webhook controller creates the local `Subscription` and links it to the billable by customer id.

One-shot payments
-----------------

[](#one-shot-payments)

For a single, mandate-less charge (Cashier's `charge()`, a one-time purchase with nothing stored for future reuse), use `charge()`. Like `checkout()` it is redirect-based and returns the same `Checkout` responsable:

```
// In a controller. Checkout is Responsable, so return it directly:
return $request->user()->charge(1999, 'EUR', 'creditcard', [
    'success_url'        => route('thanks'),
    'cancel_url'         => route('cart'),
    'description'        => 'One premium widget',
    'refund_window_days' => 30,   // 0 disables refunds; default 30; max 365
]);
```

The buyer completes the payment on the hosted Mollie page. The charge reaches a terminal state via the `one_shot_payment.succeeded` / `one_shot_payment.failed`webhooks, so react to them like any other event.

Refund a settled one-shot (within its `refund_window_days`):

```
$user->refundOneShot('osp_123');                       // full refund
$user->refundOneShot('osp_123', ['amount_cents' => 500]); // partial
```

Gate access
-----------

[](#gate-access)

```
if ($user->subscribed()) {
    // active, trialing, past_due, or within a cancel grace period
}

$user->onTrial();
$user->onGracePeriod();
```

Manage a subscription
---------------------

[](#manage-a-subscription)

```
$sub = $user->subscription();      // BillKit\Laravel\Subscription

$sub->swap('price_pro_yearly');    // change plan (proration handled server-side)
$sub->previewSwap('price_pro_yearly'); // preview the proration first
$sub->cancel();                    // cancel at period end
$sub->resume();                    // un-pause
$sub->reactivate();                // undo a scheduled cancellation
$sub->pause();

// Mandate re-auth + hosted billing portal both return a redirect URL:
return redirect($sub->updatePaymentMethod(route('billing')));
return $sub->redirectToBillingPortal(route('billing'));
```

Webhooks
--------

[](#webhooks)

The package registers `POST /billkit/webhook` (signature-verified) and keeps `Subscription` rows in sync. Point a BillKit webhook endpoint at that URL and set `BILLKIT_WEBHOOK_SECRET`. React to any event with the dispatched Laravel events:

```
use BillKit\Laravel\Events\WebhookReceived;

Event::listen(function (WebhookReceived $event) {
    if ($event->payload['type'] === 'invoice.paid') {
        // ...
    }
});
```

Logging
-------

[](#logging)

Off by default: installing the package does not switch on log output. Name a channel from `config/logging.php` to opt in:

```
BILLKIT_LOG_CHANNEL=stack
```

or in `config/billkit.php`:

```
'log_channel' => env('BILLKIT_LOG_CHANNEL'),
```

The SDK then logs one `debug` record per HTTP attempt and per response (`method`, `url`, `attempt`, `status`, `duration_ms`, `request_id`) and one `warning` per retry. The channel's own level still applies, so a channel at `info` shows the retry warnings and drops the debug lines.

A dedicated channel keeps it out of your main log:

```
// config/logging.php
'billkit' => [
    'driver' => 'daily',
    'path' => storage_path('logs/billkit.log'),
    'level' => 'debug',
    'days' => 7,
],
```

**Never logged:** your API key or the `Authorization` header; request and response **bodies** (they carry customer PII); the **query string** (list filters carry values like `email=`). Failed calls throw a typed `BillKitException` rather than being logged, so you never get a duplicate entry. Catch it and log it your own way.

Development
-----------

[](#development)

```
composer install
composer test      # PHPUnit via orchestra/testbench
composer analyse   # PHPStan + larastan
composer cs:check  # php-cs-fixer (@PSR12)
```

License
-------

[](#license)

Apache-2.0

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance100

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

0d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/291105088?v=4)[BillKit EU](/maintainers/billkit-eu)[@billkit-eu](https://github.com/billkit-eu)

---

Top Contributors

[![nicholasamorim](https://avatars.githubusercontent.com/u/2200260?v=4)](https://github.com/nicholasamorim "nicholasamorim (2 commits)")

---

Tags

laravelstripebillingmolliesubscriptionssaascashiereubillkit

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/billkit-eu-billkit-laravel/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[api-platform/laravel

API Platform support for Laravel

58190.1k21](/packages/api-platform-laravel)[laravel/cashier

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

2.5k31.8M163](/packages/laravel-cashier)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k16.3M158](/packages/laravel-pulse)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9922.4M147](/packages/roots-acorn)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

265.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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