PHPackages                             ptuchik/billing - 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. ptuchik/billing

ActiveLibrary[Payment Processing](/categories/payments)

ptuchik/billing
===============

Billing package for Laravel 5.5 supporting packages, plans, coupons, addons, payments and subscriptions

1.9.7(1y ago)3021.2k13[1 issues](https://github.com/ptuchik/billing/issues)MITPHP

Since Feb 27Pushed 1y ago2 watchersCompare

[ Source](https://github.com/ptuchik/billing)[ Packagist](https://packagist.org/packages/ptuchik/billing)[ RSS](/packages/ptuchik-billing/feed)WikiDiscussions master Synced 1w ago

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

Billing
=======

[](#billing)

`WARNING!!! If you are already using v1.x version, please stay on it, v2.x may have some backward incompatibilities...`

Sell anything for everything...
-------------------------------

[](#sell-anything-for-everything)

[![Latest Stable Version](https://camo.githubusercontent.com/a363685ce93592d28af38b11be35d8870218087eb91ead3784d38b13b7c22a24/68747470733a2f2f706f7365722e707567782e6f72672f7074756368696b2f62696c6c696e672f76657273696f6e2e706e67)](https://packagist.org/packages/ptuchik/billing)[![Total Downloads](https://camo.githubusercontent.com/909874e3ebeb5659ed90dbcfbe479bab44d613cb39f485513d67525eb99301fc/68747470733a2f2f706f7365722e707567782e6f72672f7074756368696b2f62696c6c696e672f642f746f74616c2e706e67)](https://packagist.org/packages/ptuchik/billing)

Billing package for Laravel 5.5+ supporting packages, plans, coupons, addons, payments and subscriptions with multi currencies

---

### Structure:

[](#structure)

The structure is the following:

- *Billable* - Model that will pay for everything
- *Hostable* - Model for which can be purchased everything
- *Package* - Model that can be purchased
- *Plan* - Model that will sell the *Package*
- *Reference* - Can be any model, that will be purchased with *Package*
- *Coupon* - Discount, which can be applied on *Plan* purchase

---

### Concept

[](#concept)

The concept is the following: To be able to use this package, firstly you need to add `Billable` trait to your billable model and implement `Billable` interface (usually it is *User* model). Hostable models have to implement `Hostable` interface and use `Hostable` trait, which will add *Purchases* relation to model. All packages have to be extended from *PackageModel* abstract class. That's it!

P. S. Everything is overridable from configuration, provided by package

---

### Installation

[](#installation)

```
composer require ptuchik/billing

```

After composer installation, just run `php artisan migrate` as usual, to have the additional tables added to your database and publish configurations by executing:

```
php artisan vendor:publish --provider="Torann\Currency\CurrencyServiceProvider" --tag=config
php artisan vendor:publish --provider="Ptuchik\Billing\Providers\BillingServiceProvider" --tag=config
php artisan vendor:publish --provider="Ptuchik\CoreUtilities\Providers\CoreUtilitiesServiceProvider" --tag=config

```

**IMPORTANT!**Your billable model has to have the following attributes:

- `balance` - cast: *numeric*
- `paymentGateway` - cast: *string*
- `paymentProfiles` - cast: *array*
- `currency` - cast: *string*
- `params` - cast: *array*

and `isTester()` method, which will indicate if your billable model is tester or customer, to set the correct mode of payment gateway environment. If you don't need testers, you can just create the following method in your billable model:

```
public function isTester() {
    return false;
}
```

---

### Usage

[](#usage)

To get the plan details, with trial days calculation and summary (all coupons and available balance discounts applied) for current user on current host, just call:

```
$plan->prepare($hostable); // Will return plan with all calculations applied for logged in user
```

To purchase the plan, just call:

```
$plan->purchase($hostable); // It will do the rest automagically
```

---

### Documentation

[](#documentation)

Coming soon...

---

### Special thanks to

[](#special-thanks-to)

- [Taylor Otwell](mailto:taylor@laravel.com) for the best framework - [Laravel](https://laravel.com/)
- [Daniel Stainback aka Torann](mailto:torann@gmail.com) for [Currencies](http://lyften.com/projects/laravel-currency/)
- [Spatie](mailto:info@spatie.be) for [Translatable package](https://github.com/spatie/laravel-translatable)
- [The League of Extraordinary Packages](http://thephpleague.com) for [Omnipay - multi-gateway payment processing library](https://omnipay.thephpleague.com/)

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 97.1% 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 ~21 days

Recently: every ~57 days

Total

118

Last Release

542d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/97d8960403b7a3aee623f5b5ea9964219b6d23abc8a5c6b893a0832ddcf2d70f?d=identicon)[ptuchik](/maintainers/ptuchik)

---

Top Contributors

[![ptuchik](https://avatars.githubusercontent.com/u/4479697?v=4)](https://github.com/ptuchik "ptuchik (431 commits)")[![Samvel-Sargsyan](https://avatars.githubusercontent.com/u/59954269?v=4)](https://github.com/Samvel-Sargsyan "Samvel-Sargsyan (8 commits)")[![miqayelsrapionyan](https://avatars.githubusercontent.com/u/66951632?v=4)](https://github.com/miqayelsrapionyan "miqayelsrapionyan (1 commits)")[![amirhosseindz](https://avatars.githubusercontent.com/u/8266844?v=4)](https://github.com/amirhosseindz "amirhosseindz (1 commits)")[![RazmikSaghoyan](https://avatars.githubusercontent.com/u/28092645?v=4)](https://github.com/RazmikSaghoyan "RazmikSaghoyan (1 commits)")[![miqo-srapionyan](https://avatars.githubusercontent.com/u/29629463?v=4)](https://github.com/miqo-srapionyan "miqo-srapionyan (1 commits)")[![Hovakimyannn](https://avatars.githubusercontent.com/u/79104618?v=4)](https://github.com/Hovakimyannn "Hovakimyannn (1 commits)")

---

Tags

laravelbillingsubscriptionspurchasecurrenciesdiscountscouponsplansptuchik

### Embed Badge

![Health badge](/badges/ptuchik-billing/health.svg)

```
[![Health](https://phpackages.com/badges/ptuchik-billing/health.svg)](https://phpackages.com/packages/ptuchik-billing)
```

###  Alternatives

[mollie/laravel-cashier-mollie

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

172155.4k1](/packages/mollie-laravel-cashier-mollie)[chargebee/cashier

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

627.4k1](/packages/chargebee-cashier)[mmanos/laravel-billing

A billing package for Laravel 4.

451.3k](/packages/mmanos-laravel-billing)[asciisd/knet

Knet package is provides an expressive, fluent interface to KNet's payment services.

141.1k](/packages/asciisd-knet)

PHPackages © 2026

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