PHPackages                             ars/laravel-cashier - 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. ars/laravel-cashier

ActiveLibrary[Payment Processing](/categories/payments)

ars/laravel-cashier
===================

A powerful package for Laravel that facilitates seamless management of virtual currency, transaction handling, balance management, and fund transfers within your applications.

v0.0.3(1y ago)115MITPHPPHP &gt;=8.0

Since Aug 25Pushed 1y ago1 watchersCompare

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

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

Laravel Cashier Wallet Package
==============================

[](#laravel-cashier-wallet-package)

[![License](https://camo.githubusercontent.com/a7d1e5a98b41667517f813ef92bd49a17fbf4b775a8f4e499b214e186d306c22/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f616c6972657a613230303073616a6564692f6c61726176656c2d63617368696572)](LICENSE)

A powerful package for Laravel that facilitates seamless management of virtual currency, transaction handling, balance management, and fund transfers within your applications.

Features
--------

[](#features)

- **Wallet Management:** Create and manage wallets associated with users or other entities.
- **Payment Handling:** Manage payments, including initiation, processing, and transaction logging.
- **Transaction Management:** Record and track all wallet-related transactions, including deposits and withdrawals.
- **Configurable Withdraw Ceiling:** Set a ceiling limit for withdrawals through configuration.

Requirements:
-------------

[](#requirements)

- Laravel Version: 10 or higher
- PHP Version: 8.0 or higher

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

[](#installation)

To install the package, use Composer:

```
composer require ars/laravel-cashier
```

After installation, publish the configuration and migration files:

```
php artisan vendor:publish --provider="Ars\Cashier\Providers\CashierServiceProvider"
```

Then, run the migrations:

```
php artisan migrate
```

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

[](#configuration)

The package comes with a configuration file located at `config/cashier.php`. Key configuration options include:

- **`wallet.ceiling_withdraw`:** The default withdrawal ceiling.
- **`tables`:** Customizable table names for wallets, payments, and transactions.

```
return [
    'wallet' => [
        'ceiling_withdraw' => 0,
    ],
    'tables' => [
        'wallet' => 'wallets',
        'payment' => 'payments',
        'transaction' => 'transactions',
    ],
];
```

Usage
-----

[](#usage)

### Traits

[](#traits)

#### HasWallet

[](#haswallet)

Add the `HasWallet` trait to any model that should have a wallet:

```
use Ars\Cashier\Models\Traits\HasWallet;

class User extends Model
{
    use HasWallet;
}
```

- **Get Balance:** Retrieve the wallet balance with:

    ```
    $balance = $user->balance;
    ```
- **Deposit:**

    ```
    $user->deposit(100, ['description' => 'Initial deposit']);
    ```

    This will increase the user’s wallet balance by 100 and log the transaction.
- **Withdraw:**

    ```
    $user->withdraw(50, ['description' => 'Purchase withdrawal']);
    ```

    This will decrease the user’s wallet balance by 50, if within the allowable ceiling, and log the transaction.
- **Check Withdraw Capability:**

    ```
    if ($user->canWithdraw(50, 10)) {
        echo "Withdrawal allowed";
    } else {
        echo "Withdrawal exceeds allowed limits";
    }
    ```

#### HasPay

[](#haspay)

Add the `HasPay` trait to any model that should handle payments:

```
use Ars\Cashier\Models\Traits\HasPay;

class Order extends Model
{
    use HasPay;
}
```

- **Initiate Payment:**

    ```
    $payment = $order->requestPay('AUTH123', 200, ['order_id' => $order->id]);
    ```

    This starts a payment process and logs it as a transaction.
- **Process Payment Result:**

    ```
    $result = $order->resultPay('AUTH123', '00', 'REF456');
    ```

    This updates the payment details and marks the associated transaction as accepted.
- **Access Payment Transaction:**

    ```
    $transaction = $payment->transaction;
    ```

    You can access the transaction associated with a specific payment.

### Wallet Model

[](#wallet-model)

The `Wallet` model manages user balances and transactions.

- **Get All Transactions:**

    ```
    $transactions = $wallet->transactions;
    foreach ($transactions as $transaction) {
        echo $transaction->amount . " - " . $transaction->type;
    }
    ```
- **Set Custom Withdrawal Ceiling:**

    ```
    $wallet->ceilingWithdraw = 500;
    ```

    You can dynamically adjust the ceiling for withdrawals on a specific wallet.

### Payment Model

[](#payment-model)

The `Payment` model handles payment processing and recording.

- **Retrieve Payment by Authority:**

    ```
    $payment = Payment::where('authority', 'AUTH123')->first();
    ```

    This retrieves a payment record based on its authority code.
- **Update Payment Status:**

    ```
    $payment->update(['status_code' => '00', 'payed_at' => now()]);
    ```

    This updates the status of a payment, which can be useful in payment processing callbacks.

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

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

[](#contributing)

Contributions are welcome! Please submit a pull request or create an issue for any improvements or suggestions.

Support
-------

[](#support)

For any issues, please visit the [Issues page](https://github.com/alireza2000sajedi/laravel-cashier/issues).

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity36

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

Every ~4 days

Total

3

Last Release

615d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/06fa4d332d575f1bcee0f091115409cbae2070d1b519e4e0e44f00ee7fc58c6e?d=identicon)[alireza2000sajedi](/maintainers/alireza2000sajedi)

---

Top Contributors

[![alireza2000sajedi](https://avatars.githubusercontent.com/u/36206809?v=4)](https://github.com/alireza2000sajedi "alireza2000sajedi (11 commits)")

---

Tags

laravellaravel-packagepaymenttransactionswalletcashierfinancialvirtual-currencybalance managementfund transfers

### Embed Badge

![Health badge](/badges/ars-laravel-cashier/health.svg)

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

###  Alternatives

[021/laravel-wallet

Reliable and flexible wallet system for Laravel

2785.2k](/packages/021-laravel-wallet)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

852.2k1](/packages/musahmusah-laravel-multipayment-gateways)

PHPackages © 2026

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