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

ActiveLibrary[Payment Processing](/categories/payments)

smskin/laravel-billing
======================

Billing module for laravel projects

2.0.8(1y ago)1217[1 PRs](https://github.com/smskin/laravel-billing/pulls)MITPHPPHP ^8.1CI passing

Since May 6Pushed 8mo ago1 watchersCompare

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

READMEChangelogDependencies (7)Versions (13)Used By (0)

Billing Module for Laravel Projects
===================================

[](#billing-module-for-laravel-projects)

Description
-----------

[](#description)

This module supports both synchronous and asynchronous interaction with billing.

Concept
-------

[](#concept)

Any object can participate in billing. To do this, simply implement the Billingable interface and include the BillingableTrait. The billing system doesn't care if it's an object in the database or just a class with statically declared properties.

Applications:

- Billingable objects as users (transferring funds from one user to another)
- Billingable objects as accounts in the accounting system (e.g., user's own and credit accounts)
- Billingable objects as part of a business process (e.g., Customer -&gt; Task -&gt; Performer)

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

[](#installation)

```
composer require smskin/laravel-billing
php artisan vendor:publish --provider="SMSkin\Billing\Providers\ServiceProvider"
```

This will create:

- a configuration file at `/config/billing.php`
- a database migration file at `/database/migrations/_create_billing_operations_table.php`

If necessary, you can change the table name for storing billing operations in the configuration file (`billing.table`).

```
php artisan migrate
```

Basic Usage

To start using billing, you need to create an object that implements the Billingable interface. For convenience, a Trait is prepared, which implements part of the interface methods - BillingableTrait.

```
