PHPackages                             beebmx/laravel-pay - 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. beebmx/laravel-pay

ActiveLibrary[Payment Processing](/categories/payments)

beebmx/laravel-pay
==================

Create payments with Laravel

0.8.0(1y ago)243MITPHP ^8.2

Since Dec 30Compare

[ Source](https://github.com/beebmx/laravel-pay)[ Packagist](https://packagist.org/packages/beebmx/laravel-pay)[ RSS](/packages/beebmx-laravel-pay/feed)WikiDiscussions Synced today

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

Payments for Laravel
====================

[](#payments-for-laravel)

[![Latest Stable Version](https://camo.githubusercontent.com/79e36f1a530a94ea3be9fea6ed3fad7e29c593864e43a46b68c4e480a5afc89c/68747470733a2f2f706f7365722e707567782e6f72672f626565626d782f6c61726176656c2d7061792f76)](//packagist.org/packages/beebmx/laravel-pay)[![License](https://camo.githubusercontent.com/7578a07a221f653c5c4720f181ddfdd9480472b1426cef3416e1efb1fb2cbb0f/68747470733a2f2f706f7365722e707567782e6f72672f626565626d782f6c61726176656c2d7061792f6c6963656e7365)](//packagist.org/packages/beebmx/laravel-pay)

Payments for Laravel is inspired by the official [Laravel Cashier](https://laravel.com/docs/10.x/billing). The approach is slightly different to `Cashier` and the main behavior is the payment transactions.

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

[](#installation)

You can install the package via composer:

```
composer require beebmx/laravel-pay
```

You can publish and run the migrations with:

```
php artisan vendor:publish --provider="Beebmx\LaravelPay\PayServiceProvider" --tag="pay-migrations"
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --provider="Beebmx\LaravelPay\PayServiceProvider" --tag="pay-config"
```

Configuration
-------------

[](#configuration)

Before use `Payments for Laravel` you need to add the `Payable` trait to your user model, the default location of this is in `App\Models\Users`:

```
use Beebmx\LaravelPay\Payable;

class User extends Authenticatable {

    use Payable;
}
```

### Custom models

[](#custom-models)

You can use your own models to fit your needs, just set in the `App\Providers\AppServiceProvider` and inform Payments for Laravel in the `boot` method:

```
use App\Models\Address;
use App\Models\Pay\User;
use App\Models\Transaction;
use App\Models\TransactionItem;
use Beebmx\LaravelPay\Pay;

/**
 * Bootstrap any application services.
 *
 * @return void
 */
public function boot()
{
    Pay::useCustomerModel(User::class);
    Pay::useAddressModel(Address::class);
    Pay::useTransactionModel(Transaction::class);
    Pay::useTransactionItemModel(TransactionItem::class);
}
```

Just remember, if you change this for your own models, make sure to extend these models with the `Payments for Laravel`:

```
use Beebmx\LaravelPay\Address as PayAddress;

class Address extends PayAddress
{
    //
}
```

Drivers
-------

[](#drivers)

### Sandbox

[](#sandbox)

This works as a playground, with full capabilities as a testing or production driver.

### Stripe

[](#stripe)

To work with the `stripe` driver you need to set as default driver and configurate your `testing` or `production` keys:

```
