Weave Code
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

Cancel Transaction

Sometimes you need to cancel a confirmed transaction. For example, money was received or debited by mistake. You can reset the confirmation of a specific transaction.

User Model

Add the CanConfirm trait and Confirmable interface to your User model.

use Zotel\Wallet\Interfaces\Confirmable;
use Zotel\Wallet\Interfaces\Wallet;
use Zotel\Wallet\Traits\CanConfirm;
use Zotel\Wallet\Traits\HasWallet;

class UserConfirm extends Model implements Wallet, Confirmable
{
    use HasWallet, CanConfirm;
}

You can only cancel the transaction with the wallet you paid with.

To cancel

Example:

Created a transaction, and after resetting its confirmation.

$user->balance; // 0
$transaction = $user->deposit(100); // confirmed transaction 
$transaction->confirmed; // bool(true)
$user->balance; // 100

$user->resetConfirm($transaction); // bool(true)
$transaction->confirmed; // bool(false)

$user->balance; // 0 

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.
calmfox/watch-sylius
damienfern/grpc-symfony-bundle
atoolo/index-bundle
atoolo/genai-bundle
coprotoai/laravel-ticket
davidjln/llm-carbon-bundle
cryonighter/valid-request-bundle
coolms/taxonomy-bundle
coolms/field-bundle
articulate-orm/symfony
aaix/laravel-tall-architect
ephoto/akeneo-connector
emmanuelballery/eb-plantumlbundle
emielburgman/symfony-visitor-beacon
emielburgman/symfony-visit-storage
emielburgman/symfony-security-headers
emielburgman/symfony-log-viewer
emarref/xdebug-bundle
emarref/pubnub-bundle
elriseio/finance-money-bundle