Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Wallet Laravel Package

zotel/laravel-wallet

View on GitHub
Deep Wiki
Context7

Credit Limits

If you need the ability to have wallets have a credit limit, then this functionality is for you.

The functionality does nothing, it only allows you not to use "force" for most of the operations within the credit limit. You should write the logic for collecting interest, notifications on debts, etc.

By default, the credit limit is zero.

An example of working with a credit limit:

/**
 * [@var](https://github.com/var) \Zotel\Wallet\Interfaces\Customer $customer
 * [@var](https://github.com/var) \Zotel\Wallet\Models\Wallet $wallet
 * [@var](https://github.com/var) \Zotel\Wallet\Interfaces\ProductInterface $product
 */
$wallet = $customer->wallet; // get default wallet
$wallet->meta['credit'] = 10000; // credit limit
$wallet->save(); // update credit limit

$wallet->balanceInt; // 0
$product->getAmountProduct($customer); // 500

$wallet->pay($product); // success
$wallet->balanceInt; // -500

For multi-wallets when creating:

/** [@var](https://github.com/var) \Zotel\Wallet\Traits\HasWallets $user */
$wallet = $user->createWallet([
    'name' => 'My Wallet',
    'meta' => ['credit' => 500],
]);

It's simple!

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route