laravel-wallet - Easy work with virtual wallet.

Overview

Laravel Wallet

Maintainability Test Coverage Financial Contributors on Open Collective Mutation testing badge

Package Rank Latest Stable Version Latest Unstable Version License composer.lock

Sparkline

laravel-wallet - Easy work with virtual wallet.

[Documentation] [Get Started]

[Документация] [Как начать]

  • Vendor: bavix
  • Package: laravel-wallet
  • Version: Latest Stable Version
  • PHP Version: 7.3+ (if you are using version 5.x then 7.2+)
  • Laravel Version: 5.5, 5.6, 5.7, 5.8, 6.x, 7.x, 8.x
  • Composer: composer require bavix/laravel-wallet

Upgrade Guide

Starting with version 5.x, support for Laravel 5 has been discontinued. Update laravel or use version 4.x.

To perform the migration, you will be helped by the instruction.

Extensions

Extension Description
Swap Addition to the laravel-wallet library for quick setting of exchange rates
Vacuum Addition to the laravel-wallet library for quick fix race condition

Usage

Add the HasWallet trait and Wallet interface to model.

use Bavix\Wallet\Traits\HasWallet;
use Bavix\Wallet\Interfaces\Wallet;

class User extends Model implements Wallet
{
    use HasWallet;
}

Now we make transactions.

$user = User::first();
$user->balance; // int(0)

$user->deposit(10);
$user->balance; // int(10)

$user->withdraw(1);
$user->balance; // int(9)

$user->forceWithdraw(200, ['description' => 'payment of taxes']);
$user->balance; // int(-191)

Purchases

Add the CanPay trait and Customer interface to your User model.

use Bavix\Wallet\Traits\CanPay;
use Bavix\Wallet\Interfaces\Customer;

class User extends Model implements Customer
{
    use CanPay;
}

Add the HasWallet trait and Product interface to Item model.

use Bavix\Wallet\Traits\HasWallet;
use Bavix\Wallet\Interfaces\Product;
use Bavix\Wallet\Interfaces\Customer;

class Item extends Model implements Product
{
    use HasWallet;

    public function canBuy(Customer $customer, int $quantity = 1, bool $force = null): bool
    {
        /**
         * If the service can be purchased once, then
         *  return !$customer->paid($this);
         */
        return true; 
    }
    
    public function getAmountProduct(Customer $customer)
    {
        return 100;
    }

    public function getMetaProduct(): ?array
    {
        return [
            'title' => $this->title, 
            'description' => 'Purchase of Product #' . $this->id,
        ];
    }
    
    public function getUniqueId(): string
    {
        return (string)$this->getKey();
    }
}

Proceed to purchase.

$user = User::first();
$user->balance; // int(100)

$item = Item::first();
$user->pay($item); // If you do not have enough money, throw an exception
var_dump($user->balance); // int(0)

if ($user->safePay($item)) {
  // try to buy again )
}

var_dump((bool)$user->paid($item)); // bool(true)

var_dump($user->refund($item)); // bool(true)
var_dump((bool)$user->paid($item)); // bool(false)

Eager Loading

User::with('wallet');

How to work with fractional numbers?

Add the HasWalletFloat trait and WalletFloat interface to model.

use Bavix\Wallet\Traits\HasWalletFloat;
use Bavix\Wallet\Interfaces\WalletFloat;
use Bavix\Wallet\Interfaces\Wallet;

class User extends Model implements Wallet, WalletFloat
{
    use HasWalletFloat;
}

Now we make transactions.

$user = User::first();
$user->balance; // int(100)
$user->balanceFloat; // float(1.00)

$user->depositFloat(1.37);
$user->balance; // int(237)
$user->balanceFloat; // float(2.37)

Supported by

Supported by JetBrains

Contributors

Code Contributors

This project exists thanks to all the people who contribute. [Contribute].

Financial Contributors

Become a financial contributor and help us sustain our community. [Contribute]

Individuals

Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]

Comments
  • TransactionStartException will always be throwed in tests with RefreshDatabase trait

    TransactionStartException will always be throwed in tests with RefreshDatabase trait

    Describe your task The test suite in laravel are always executed inside a database transaction if you're using the LazilyRefreshDatabase trait. After v8.2, all tests that has a wallet transaction are broken

    To Reproduce Steps to reproduce the behavior:

    1. write an action that has a app(DatabaseServiceInterface::class)->transaction.
    2. write a test with LazilyRefreshDatabase trait.

    Expected behavior The test will broke with "Bavix\Wallet\Internal\Exceptions\TransactionStartException : Working inside an embedded transaction is not possible", but this transaction was started by the framework itself, not in userland.

    Server:

    • php version: 8.1
    • database: postgres 14
    • wallet version 8.2
    • cache lock: redis
    • cache wallets: redis
    good issue question wontfix 
    opened by ibrunotome 19
  • After Confirm the Transaction the wallet of user not updates

    After Confirm the Transaction the wallet of user not updates

    After Confirm the Transaction the wallet of user not update

    For Example

    $user->balance; // 0 $transaction = $user->deposit(100, null, false); $user->balance; // 0

    $user->confirm($transaction); $user->balance; // 0 => Not Changed

    Can help me please

    bug good issue question Stale 
    opened by MahmoudSaidHaggag 18
  • Unable to perform refund with wallet version 9.6

    Unable to perform refund with wallet version 9.6

    Describe the bug Whenever am trying to refund an order (Purchase) am getting the error below:

    Bavix\Wallet\Internal\Exceptions\TransactionFailedException
    
    Transaction failed. Message: SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 2
    
    insert into `transactions` (`amount`, `confirmed`, `created_at`, `meta`, `payable_id`, `payable_type`, `type`, `updated_at`, `uuid`, `wallet_id`) 
    values (-1150.00, 1, 2022-11-07 06:00:41, {"title":"Order from B2C-pickup::CO0057","description":"Purchase of Order #CO0057"}, 369, App\Models\Order, withdraw, 2022-11-07 06:00:41, 413b7a9d-1abe-49a6-baa1-35a34093bd05, 874), 
    (1150.00, 0, 1, 2022-11-07 06:00:41, 2023-11-07 06:00:41, {"title":"Order from B2C-pickup::CO0057","description":"Purchase of Order #CO0057"}, 1037, App\Models\User, deposit, 2022-11-07 06:00:41, bc76ac59-400b-44c5-b6ab-a4368075517d, 470)
    

    Am using below to refund a purchase.

    $order=Order::find(369);
    $ouser = User::without(['role','wallet','lastTransaction','defaultAddress'])->with('wallets')->find($order->user_id);
    $walletFull = $ouser->wallets[0];
    $walletZero = $ouser->wallets[1];
    $fullValue = $order->full_credit_used ?? 0;
    $zeroValue = $order->zero_credit_used ?? 0;
    $orderWallet = $order->wallet;
    if($walletFull->refund($order)) {
        $walletFull->refreshBalance();
        if ($zeroValue > 0) {                
            $walletFull->transferFloat($walletZero, $zeroValue);
            $walletFull->refreshBalance();
            $walletZero->refreshBalance();
            $this->manageLastTransaction($walletZero,$this->order);
        }
        $this->manageLastTransaction($walletFull,$this->order,$fullValue);
    }
    

    Furthermore, a transfer is also giving the same error, i.e, "1136 Column count doesn't match value count at row 2", Transfer logic is stated below

    $metaDeposit =  [
              'description' => 'Refund from Order #'.$this->order->order_number,
              'credit_type' => 'Refunded credits',
              'expire_on'   => Carbon::now()->addYear()
          ];
      $metaWithdraw =  [
              'description' => 'Refund for Order #'.$this->order->order_number,
          ];
      $transferMeta = new Extra(
          deposit: $metaDeposit,
          withdraw: new Option(meta: $metaWithdraw)
      );
      $orderWallet->transfer($walletFull, $fullValue, $transferMeta);
    

    Trace Error

    [2022-11-07 06:34:33] local.ERROR: Transaction failed. Message: SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 2 (SQL: insert into `transactions` (`amount`, `confirmed`, `created_at`, `meta`, `payable_id`, `payable_type`, `type`, `updated_at`, `uuid`, `wallet_id`) values (-1150.00, 1, 2022-11-07 06:34:33, {"title":"Order from B2C-pickup::CO0057","description":"Purchase of Order #CO0057"}, 369, App\Models\Order, withdraw, 2022-11-07 06:34:33, 5240b919-5bb9-4448-976b-828c532eb09a, 874), (1150.00, 0, 1, 2022-11-07 06:34:33, 2023-11-07 06:34:33, {"title":"Order from B2C-pickup::CO0057","description":"Purchase of Order #CO0057"}, 1037, App\Models\User, deposit, 2022-11-07 06:34:33, a90558e5-6234-47ce-a3f9-2daa8d790c2d, 470)) {"exception":"[object] (Bavix\\Wallet\\Internal\\Exceptions\\TransactionFailedException(code: 1024): Transaction failed. Message: SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 2 (SQL: insert into `transactions` (`amount`, `confirmed`, `created_at`, `meta`, `payable_id`, `payable_type`, `type`, `updated_at`, `uuid`, `wallet_id`) values (-1150.00, 1, 2022-11-07 06:34:33, {\"title\":\"Order from B2C-pickup::CO0057\",\"description\":\"Purchase of Order #CO0057\"}, 369, App\\Models\\Order, withdraw, 2022-11-07 06:34:33, 5240b919-5bb9-4448-976b-828c532eb09a, 874), (1150.00, 0, 1, 2022-11-07 06:34:33, 2023-11-07 06:34:33, {\"title\":\"Order from B2C-pickup::CO0057\",\"description\":\"Purchase of Order #CO0057\"}, 1037, App\\Models\\User, deposit, 2022-11-07 06:34:33, a90558e5-6234-47ce-a3f9-2daa8d790c2d, 470)) at /var/www/html/better_cloud/vendor/bavix/laravel-wallet/src/Internal/Service/DatabaseService.php:47)
    [stacktrace]
    #0 /var/www/html/better_cloud/vendor/bavix/laravel-wallet/src/Services/TransferService.php(107): Bavix\\Wallet\\Internal\\Service\\DatabaseService->transaction()
    #1 /var/www/html/better_cloud/vendor/bavix/laravel-wallet/src/Traits/CartPay.php(235): Bavix\\Wallet\\Services\\TransferService->apply()
    #2 /var/www/html/better_cloud/vendor/bavix/laravel-wallet/src/Internal/Service/DatabaseService.php(34): Bavix\\Wallet\\Models\\Wallet->Bavix\\Wallet\\Traits\\{closure}()
    #3 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Database/Concerns/ManagesTransactions.php(30): Bavix\\Wallet\\Internal\\Service\\DatabaseService->Bavix\\Wallet\\Internal\\Service\\{closure}()
    #4 /var/www/html/better_cloud/vendor/bavix/laravel-wallet/src/Internal/Service/DatabaseService.php(41): Illuminate\\Database\\Connection->transaction()
    #5 /var/www/html/better_cloud/vendor/bavix/laravel-wallet/src/Services/AtomicService.php(59): Bavix\\Wallet\\Internal\\Service\\DatabaseService->transaction()
    #6 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Cache/Lock.php(126): Bavix\\Wallet\\Services\\AtomicService->Bavix\\Wallet\\Services\\{closure}()
    #7 /var/www/html/better_cloud/vendor/bavix/laravel-wallet/src/Internal/Service/LockService.php(55): Illuminate\\Cache\\Lock->block()
    #8 /var/www/html/better_cloud/vendor/bavix/laravel-wallet/src/Internal/Service/LockService.php(75): Bavix\\Wallet\\Internal\\Service\\LockService->block()
    #9 /var/www/html/better_cloud/vendor/bavix/laravel-wallet/src/Internal/Service/LockService.php(79): Bavix\\Wallet\\Internal\\Service\\LockService->Bavix\\Wallet\\Internal\\Service\\{closure}()
    #10 /var/www/html/better_cloud/vendor/bavix/laravel-wallet/src/Services/AtomicService.php(63): Bavix\\Wallet\\Internal\\Service\\LockService->blocks()
    #11 /var/www/html/better_cloud/vendor/bavix/laravel-wallet/src/Services/AtomicService.php(79): Bavix\\Wallet\\Services\\AtomicService->blocks()
    #12 /var/www/html/better_cloud/vendor/bavix/laravel-wallet/src/Traits/CartPay.php(240): Bavix\\Wallet\\Services\\AtomicService->block()
    #13 /var/www/html/better_cloud/vendor/bavix/laravel-wallet/src/Traits/CanPay.php(94): Bavix\\Wallet\\Models\\Wallet->refundCart()
    #14 /var/www/html/better_cloud/app/Http/Controllers/HomeController.php(95): Bavix\\Wallet\\Models\\Wallet->refund()
    #15 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\\Http\\Controllers\\HomeController->jugad()
    #16 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(43): Illuminate\\Routing\\Controller->callAction()
    #17 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Routing/Route.php(260): Illuminate\\Routing\\ControllerDispatcher->dispatch()
    #18 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\\Routing\\Route->runController()
    #19 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Routing/Router.php(725): Illuminate\\Routing\\Route->run()
    #20 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()
    #21 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
    #22 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle()
    #23 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
    #24 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle()
    #25 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
    #26 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle()
    #27 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
    #28 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest()
    #29 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Session\\Middleware\\StartSession->handle()
    #30 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
    #31 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle()
    #32 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
    #33 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle()
    #34 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
    #35 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Routing/Router.php(726): Illuminate\\Pipeline\\Pipeline->then()
    #36 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Routing/Router.php(703): Illuminate\\Routing\\Router->runRouteWithinStack()
    #37 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Routing/Router.php(667): Illuminate\\Routing\\Router->runRoute()
    #38 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Routing/Router.php(656): Illuminate\\Routing\\Router->dispatchToRoute()
    #39 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(190): Illuminate\\Routing\\Router->dispatch()
    #40 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}()
    #41 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
    #42 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
    #43 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle()
    #44 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
    #45 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
    #46 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle()
    #47 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
    #48 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle()
    #49 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
    #50 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle()
    #51 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
    #52 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Http\\Middleware\\HandleCors->handle()
    #53 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
    #54 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Http\\Middleware\\TrustProxies->handle()
    #55 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
    #56 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(165): Illuminate\\Pipeline\\Pipeline->then()
    #57 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(134): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter()
    #58 /var/www/html/better_cloud/public/index.php(52): Illuminate\\Foundation\\Http\\Kernel->handle()
    #59 /var/www/html/better_cloud/vendor/laravel/framework/src/Illuminate/Foundation/resources/server.php(16): require_once('...')
    #60 {main}
    

    Server:

    • php version: [8.0.25]
    • database: [mysql Ver 8.0.31]
    • wallet version [9.6.0]
    • cache lock: [array]
    • cache wallets: [array]
    bug question 
    opened by hilal-hipster 17
  • Confliction With Laravel Cashier

    Confliction With Laravel Cashier

    Describe the bug Already handling subscriptions with Laravel Cashier, so as per Laravel Cashier my User Model contains Cahier's Billable trait

    use Laravel\Cashier\Billable; 
    class User extends Authenticatable
    {
       use Billable;
        ....
        ....
    }
    

    Now, need to use Wallet's Purchases feature So Changed my User model to this

    use Laravel\Cashier\Billable;
    use Bavix\Wallet\Traits\HasWallet;
    use Bavix\Wallet\Interfaces\Wallet;
    use Bavix\Wallet\Traits\CanPay;
    use Bavix\Wallet\Interfaces\Customer;
    class User extends \TCG\Voyager\Models\User implements Customer
    {
        use Billable, HasApiTokens, HasFactory, Notifiable, SoftDeletes, HasWallet;
        use CanPay;
        .......
        .....
    

    But now I am getting below error and even unable to serve. **PHP Fatal error: Trait method Bavix\Wallet\Traits\CanPay::pay has not been applied as App\Models\User::pay, because of collision with Laravel\Cashier\Billable::pay in /var/www/html/better_cloud/app/Models/User.php on line 20

    Symfony\Component\ErrorHandler\Error\FatalError

    Trait method Bavix\Wallet\Traits\CanPay::pay has not been applied as App\Models\User::pay, because of collision with Laravel\Cashier\Billable::pay**

    image

    bug duplicate question 
    opened by hilal-hipster 16
  • Recursion issue after Upgrading to 6.2.0.

    Recursion issue after Upgrading to 6.2.0.

    After upgrading to 6.2.0, the system stopped working completely yet it was displaying zero errors.

    After spending almost 5 hours trying to investigate the issue, it turned out that the update caused laravel service container itself to fall into a recursion loop when trying to fetch WalletService::class and Storable::class as it wasn't able to find their aliases in the registered alias list.

    bug good issue Stale 
    opened by AbdullahFaqeir 15
  • feat: fallback cache and lock driver

    feat: fallback cache and lock driver

    Is your feature request related to a problem? Please describe.

    Recently, I got almost 100 concurrent requests to debit balance from one wallet via api, and I got a redis exception "could not acquire lock"

    Describe the solution you'd like

    Read data directly from database when could not acquire lock (and update the state in redis in the next request)

    Describe alternatives you've considered

    Tried other cache drivers, but the only centralized is redis, array driver for example would give two different results if you access balance in a http container vs a container for queues for example.

    P.S: I would put a warning about that non centralized cache drivers in the docs.

    enhancement question 
    opened by ibrunotome 14
  • Error when try make depositFloat

    Error when try make depositFloat

    Hi.

    In the last week when try register depositFloat has next error: image

    I send an Wallet model image

    I debug directly but "($this instanceof WalletModel ? $this->holder : $this)" return null, when make inverse "($this instanceof WalletModel ? $this : $this->holder)" works fine and register deposit, how do to work fine?? image

    This is my code: Verify hasWallet and it's correct, then save $wallet and try to make depositFloat image

    Model Customer has Wallet and HasWallets to have multiple wallets and user WalletFloat image

    help wanted 
    opened by fatnaydev 14
  • Error after create

    Error after create

    Hi)) I do this: 1.

        public function index(User $user)
        {
            if(is_null($user->getWallet('refill'))){
                $user->createWallet([
                    'name' => ucfirst('refill') . 'Wallet',
                    'slug' => 'refill',
                ]);
            }
            //$user->fresh();
            //$user->wallet->fresh();
    
            dd($user->getWallet('refill'));
        }
    
    
    1. i have error
    Illuminate \ Database \ QueryException (23000)
    SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'App\Models\User-2-refill' for key 'wallets_holder_type_holder_id_slug_unique' (SQL: insert into `wallets` (`name`, `slug`, `holder_id`, `holder_type`, `updated_at`, `created_at`) values (RefillWallet, refill, 2, App\Models\User, 2019-07-05 19:05:32, 2019-07-05 19:05:32))
    
    1. refresh page
    Wallet {#638 ▼
      #fillable: array:6 [▶]
      #casts: array:1 [▶]
      #connection: "mysql"
      #table: "wallets"
      #primaryKey: "id"
      #keyType: "int"
      +incrementing: true
      #with: []
      #withCount: []
      #perPage: 15
      +exists: true
      +wasRecentlyCreated: false
      #attributes: array:9 [▶]
      #original: array:9 [▶]
      #changes: []
      #dates: []
      #dateFormat: null
      #appends: []
      #dispatchesEvents: []
      #observables: []
      #relations: []
      #touches: []
      +timestamps: true
      #hidden: []
      #visible: []
      #guarded: array:1 [▶]
    }
    

    What am I doing wrong? Thank.

    bug 
    opened by kak2z7702 14
  • The balance always cant't auto-refresh after paid

    The balance always cant't auto-refresh after paid

    I'm using version 4.1.4

    The balance cant't be auto refreshed after user paid, like user has balance of 10, and buy a product(price 10), after paid , this user still has 10. This situation not happend all the time, i don't know when it will happens, so i add

    $wallet->refreshBalance();

    after user paid.

    It just getting better, but still happens, i'm using

    • laravel 5.5

    • php 7.2

    It is very dangerous to our system, we have millions cash flow to handle per month.

    question 
    opened by CreationLee 13
  • wallet:refresh error

    wallet:refresh error

    When I execute: php artisan wallet:refresh

    I get this error:

    Illuminate\Database\QueryException : SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'balance' in field list is ambiguous (SQL: updatewalletsleft join (selectwallet_id, sum(amount) balance fromtransactionswhereconfirmed= 1 group bywallet_id) asbonwallets.id=b.wallet_idsetbalance= b.balance)

    Don't know if there is a relation, but I also have this error for refunds:

    Call to a member function morphMany() on null

    Everything else works perfectly (deposit,withdraw,pay,balance)

    Any idea?

    version 4.1 - laravel 5.8

    bug good issue 
    opened by chartalex 13
  • balance udpate is not happening in Nova Action

    balance udpate is not happening in Nova Action

    Hi

    I tried to deposit balance to a user wallet inside a Nova Action

    but the balance of the wallet is not updating ... I'm not sure if it depends to Locking mecansim or queue of laravel nova actions

    but the balance is not updating

    any suggestion ?

    enhancement good issue Stale nova 
    opened by sinamiandashti 12
  • My user primary key is in a different column

    My user primary key is in a different column

    Describe your task A clear and concise description of your task. I am using this code to specify my User primary key to use another column

    public $incrementing = false;
    protected $primaryKey = 'code';
    

    I cannot seem to find how to specify which user column to use when creating a wallet. It defaults to my 'code' column which allows string. I want to use the users.id when creating wallet.

    Server:

    • php version: 8.0
    • database: [e.g mysql 8.0]
    • wallet version [e.g. 8.2]
    question 
    opened by Intelemon 0
  • [10.x] Remove the use of the _type field in queries. Performance

    [10.x] Remove the use of the _type field in queries. Performance

    Starting from version 9.0, the package wrote the value "Wallet" in the from/to type header and used it in queries, which reduced performance. In the current PR, I want to get away from unnecessary data. The columns themselves will be removed in version 11.x

    performance 10.x-dev 
    opened by rez1dent3 3
  • Update vimeo/psalm requirement from ^4.27 to ^5.4

    Update vimeo/psalm requirement from ^4.27 to ^5.4

    Updates the requirements on vimeo/psalm to permit the latest version.

    Release notes

    Sourced from vimeo/psalm's releases.

    5.4.0

    What's Changed

    Features

    Fixes

    Internal changes

    Full Changelog: https://github.com/vimeo/psalm/compare/5.3.0...5.4.0

    Commits

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies php Stale 
    opened by dependabot[bot] 4
  • [10?] Asynchronous wallet operations

    [10?] Asynchronous wallet operations

    In 9.x, you can use the wallet association with the uuid model. I would like to add the ability to dynamically generate a key and asynchronously save transactions. This can give a good performance boost.


    There was a problem in the compatibility of contracts. The LTS version is not allowed to change the contract of these methods. If I don’t come up with a compatible API, then the feature will leave before the release of the next version.

    enhancement performance 9.x-dev frozen 
    opened by rez1dent3 2
  • [10?] Currency commodity

    [10?] Currency commodity

    At the moment, the development of this functionality is frozen. I'm not clear who needs this functionality.

    The functionality of currencies for goods is necessary for currency wallets. A product can be sold in dollars and there is a need to buy it with a euro wallet. Prior to this functionality, the developer had to check the correctness of the payment himself. I was often written that the purchase does not take into account the currency and the goods are bought one to one. For example, if the goods cost one hundred yuan, and the dollar purse, the owner of the wallet will pay one hundred dollars.


    Everything would be fine, but this approach has its drawbacks - the return of goods. When returning an item, we must refund the cost, but important data is lost when converting currencies. Perhaps this problem will prevent me from releasing this functionality.

    Now I am architecturally working on all possible options and I think that there is a need to use meta-data for the purchase. You pay with your wallet and we supplement the meta-data with the exchange rate, cost, currency and other data. The disadvantage of this approach is the limitation in the possibilities of meta-information.

    enhancement requires testing сonsider 9.x-dev frozen 
    opened by rez1dent3 2
Releases(8.4.2)
  • 8.4.2(Dec 29, 2022)

  • 7.3.5(Dec 29, 2022)

  • 9.6.0(Oct 27, 2022)

    Added

    • Full support for standard transactions and laravel nova #589

    What's Changed

    • psalm-fix by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/585
    • Bump axios from 0.27.2 to 1.1.2 by @dependabot in https://github.com/bavix/laravel-wallet/pull/586
    • Bump axios from 1.1.2 to 1.1.3 by @dependabot in https://github.com/bavix/laravel-wallet/pull/591
    • Deprecating save-state and set-output commands by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/594
    • [9.6] Event Architecture by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/589

    Full Changelog: https://github.com/bavix/laravel-wallet/compare/9.5.0...9.6.0

    Source code(tar.gz)
    Source code(zip)
  • 9.5.0(Oct 6, 2022)

    Added

    • Improved performance api handles #576

    Changed

    • Cache query optimize. v2 #580
    • Optimize StateServiceInterface #582

    Fixed

    • Memory leak. StateServiceInterface #583

    What's Changed

    • [9.5] Improved performance api handles by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/576
    • [9.5] Cache query optimize. v2 by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/580
    • [9.5] Optimize StateServiceInterface by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/582
    • [9.5] docs by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/581
    • [9.5] StateServiceInterface. Memory Leak. Optimize by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/583

    Full Changelog: https://github.com/bavix/laravel-wallet/compare/9.4.0...9.5.0

    Source code(tar.gz)
    Source code(zip)
  • 9.4.0(Sep 29, 2022)

    Added

    • Add support Model::preventSilentlyDiscardingAttributes() #574 #572
    • Add partial support octane #573 #570

    What's Changed

    • Add check php 8.2 in github actions by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/567
    • Bump size-limit from 8.0.1 to 8.1.0 by @dependabot in https://github.com/bavix/laravel-wallet/pull/568
    • [9.4] add support Model::preventSilentlyDiscardingAttributes() by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/574
    • [9.4] partial octane support by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/573

    Full Changelog: https://github.com/bavix/laravel-wallet/compare/9.3.0...9.4.0

    Source code(tar.gz)
    Source code(zip)
  • 9.3.0(Sep 6, 2022)

    Added

    • StorageServiceLockDecorator by @rez1dent3 in #563
    • StateServiceInterface by @rez1dent3 in #564
    • Add atomic-service.md by @rez1dent3 in #561

    Updated

    • Bump uuid from 8.3.2 to 9.0.0 by @dependabot in #566

    What's Changed

    • atomic-service.md by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/561
    • Bump uuid from 8.3.2 to 9.0.0 by @dependabot in https://github.com/bavix/laravel-wallet/pull/566
    • [9.3] StorageServiceLockDecorator by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/563
    • [9.3] StateServiceInterface by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/564

    Full Changelog: https://github.com/bavix/laravel-wallet/compare/9.2.0...9.3.0

    Source code(tar.gz)
    Source code(zip)
  • 9.2.0(Sep 4, 2022)

    Updated

    • upgrade actions by @rez1dent3 in #541
    • Bump size-limit from 8.0.0 to 8.0.1 by @dependabot in #543
    • Update rector/rector requirement from ^0.13 to ^0.14 by @dependabot in #544
    • Update laravel/cashier requirement from ^13.11 to ^14.0 by @dependabot in #545
    • Update linters and rules by @rez1dent3 in #547
    • Bump prismjs from 1.28.0 to 1.29.0 by @dependabot in #549

    Fixed

    • Contract phpdoc fix by @rez1dent3 in #551
    • fix TestCase by @rez1dent3 in #555

    Added

    • Add telegram link by @rez1dent3 in #553
    • Ability to dynamically create a wallet by @rez1dent3 in #550
    • Quality tests by @rez1dent3 in #554
    • Allow to use atomic service by @rez1dent3 in #548
    • docs by @rez1dent3 in #557

    Changed

    • refactoring with new phpstan by @rez1dent3 in #556

    What's Changed

    • upgrade actions by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/541
    • Bump size-limit from 8.0.0 to 8.0.1 by @dependabot in https://github.com/bavix/laravel-wallet/pull/543
    • Update rector/rector requirement from ^0.13 to ^0.14 by @dependabot in https://github.com/bavix/laravel-wallet/pull/544
    • Update laravel/cashier requirement from ^13.11 to ^14.0 by @dependabot in https://github.com/bavix/laravel-wallet/pull/545
    • Update linters and rules by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/547
    • Bump prismjs from 1.28.0 to 1.29.0 by @dependabot in https://github.com/bavix/laravel-wallet/pull/549
    • Contract phpdoc fix by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/551
    • [9.2] Ability to dynamically create a wallet by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/550
    • Add telegram link by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/553
    • [9.x] Quality tests by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/554
    • fix TestCase by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/555
    • [9.2] refactoring with new phpstan by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/556
    • [9.2] Allow to use atomic service by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/548
    • [9.2] docs by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/557
    • npm by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/558
    • update changelog.md by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/559

    Full Changelog: https://github.com/bavix/laravel-wallet/compare/9.1.0...9.2.0

    Source code(tar.gz)
    Source code(zip)
  • 9.1.0(Aug 8, 2022)

    Added

    • TransactionCreatedEvent #538 (@myckhel #535)

    Fixed

    • Fixed a bug with sending multiple events inside the queue. Extra events were sent.

    What's Changed

    • Bump size-limit from 7.0.8 to 8.0.0 by @dependabot in https://github.com/bavix/laravel-wallet/pull/537
    • [9.1] TransactionCreatedEvent by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/538

    Full Changelog: https://github.com/bavix/laravel-wallet/compare/9.0.4...9.1.0

    Source code(tar.gz)
    Source code(zip)
  • 7.3.4(Aug 8, 2022)

    Fixed

    • Fixed a bug with sending multiple events inside the queue. Extra events were sent.

    Full Changelog: https://github.com/bavix/laravel-wallet/compare/7.3.3...7.3.4

    Source code(tar.gz)
    Source code(zip)
  • 9.0.4(Jul 28, 2022)

    Fixed

    • Add allow plugin infection by @rez1dent3 in #528
    • Fix transaction amount_float mutator by @keatliang2005 in #533 #534

    Updated

    • Bump terser from 5.13.0 to 5.14.2 by @dependabot in #527
    • Bump webpack from 5.73.0 to 5.74.0 by @dependabot in #529

    What's Changed

    • add allow plugin infection by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/528
    • Bump terser from 5.13.0 to 5.14.2 by @dependabot in https://github.com/bavix/laravel-wallet/pull/527
    • Bump webpack from 5.73.0 to 5.74.0 by @dependabot in https://github.com/bavix/laravel-wallet/pull/529
    • Fix transaction amount_float mutator by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/534

    Full Changelog: https://github.com/bavix/laravel-wallet/compare/9.0.3...9.0.4

    Source code(tar.gz)
    Source code(zip)
  • 9.0.3(Jun 22, 2022)

    Fixed

    • Fixed lumen. Change CacheManager to CacheFactory for compatibility. #520 #521 @Beagon

    What's Changed

    • Bump mini-css-extract-plugin from 2.6.0 to 2.6.1 by @dependabot in https://github.com/bavix/laravel-wallet/pull/519
    • Change CacheManager to CacheFactory for compatibility with Lumen by @Beagon in #520 #521

    Full Changelog: https://github.com/bavix/laravel-wallet/compare/9.0.2...9.0.3

    Source code(tar.gz)
    Source code(zip)
  • 9.0.2(Jun 18, 2022)

    Fixed

    • Fix laravel-ide-helper generate:model #517 @keatliang2005

    What's Changed

    • Update rector/rector requirement from ^0.12 to ^0.13 by @dependabot in https://github.com/bavix/laravel-wallet/pull/507
    • update ecs, rector config by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/508
    • Bump webpack from 5.72.1 to 5.73.0 by @dependabot in https://github.com/bavix/laravel-wallet/pull/510
    • Replacing the README interface names with the correct ones by @nathanwritescode-uk in https://github.com/bavix/laravel-wallet/pull/511
    • Typos in interfaces and copy-paste by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/512
    • deptrac fix by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/515
    • Bump webpack-cli from 4.9.2 to 4.10.0 by @dependabot in https://github.com/bavix/laravel-wallet/pull/513
    • Update symplify/easy-coding-standard requirement from ^10.2 to ^11.0 by @dependabot in https://github.com/bavix/laravel-wallet/pull/514
    • Update cknow/laravel-money requirement from ^6.5 to ^7.0 by @dependabot in https://github.com/bavix/laravel-wallet/pull/518
    • Fix laravel-ide-helper generate:model by @keatliang2005 in https://github.com/bavix/laravel-wallet/pull/517

    New Contributors

    • @nathanwritescode-uk made their first contribution in https://github.com/bavix/laravel-wallet/pull/511
    • @keatliang2005 made their first contribution in https://github.com/bavix/laravel-wallet/pull/517

    Full Changelog: https://github.com/bavix/laravel-wallet/compare/9.0.1...9.0.2

    Source code(tar.gz)
    Source code(zip)
  • 9.0.1(May 19, 2022)

    Fixed

    • Fixed a bug that prevented items from being returned via Cart::withItem

    What's Changed

    • update README.md by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/494
    • update README.md by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/495
    • Bump webpack from 5.72.0 to 5.72.1 by @dependabot in https://github.com/bavix/laravel-wallet/pull/503
    • Incorrect operation of product returns by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/499

    Full Changelog: https://github.com/bavix/laravel-wallet/compare/9.0.0...9.0.1

    Source code(tar.gz)
    Source code(zip)
  • 9.0.0(May 2, 2022)

    Added

    • ExtraDtoInterface #479
    • Product custom price #485

    Changed

    • Changing the logic of funds transfers #483
    • Split Product interface #474
    • PHP 8+ Union types #482
    • Eager loading #480

    Removed

    • method Cart::addItems
    • method Cart::addItem
    • method Cart::setMeta

    Updated

    • Performance just got a little better
    • Public contracts have become stricter
    • Inside is now strongly typed

    Deprecated

    • interface Product
    • method CartPay::paid

    What's Changed

    • Bump prismjs from 1.27.0 to 1.28.0 by @dependabot in https://github.com/bavix/laravel-wallet/pull/491
    • Bump axios from 0.21.4 to 0.27.1 by @dependabot in https://github.com/bavix/laravel-wallet/pull/488
    • Bump mini-css-extract-plugin from 1.6.2 to 2.6.0 by @dependabot in https://github.com/bavix/laravel-wallet/pull/487
    • Bump size-limit from 4.12.0 to 7.0.8 by @dependabot in https://github.com/bavix/laravel-wallet/pull/490
    • Bump css-loader from 5.2.7 to 6.7.1 by @dependabot in https://github.com/bavix/laravel-wallet/pull/489
    • add rerun by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/492
    • [LTS] [9.x] Features and performance. Work on stability by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/481

    Full Changelog: https://github.com/bavix/laravel-wallet/compare/8.4.1...9.0.0

    Source code(tar.gz)
    Source code(zip)
  • 9.0.0-RC2(Apr 29, 2022)

    What's Changed

    • Bump prismjs from 1.27.0 to 1.28.0 by @dependabot in https://github.com/bavix/laravel-wallet/pull/491
    • Bump axios from 0.21.4 to 0.27.1 by @dependabot in https://github.com/bavix/laravel-wallet/pull/488
    • Bump mini-css-extract-plugin from 1.6.2 to 2.6.0 by @dependabot in https://github.com/bavix/laravel-wallet/pull/487
    • Bump size-limit from 4.12.0 to 7.0.8 by @dependabot in https://github.com/bavix/laravel-wallet/pull/490
    • Bump css-loader from 5.2.7 to 6.7.1 by @dependabot in https://github.com/bavix/laravel-wallet/pull/489
    • add rerun by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/492
    • Examples of solving problems that arise for users. by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/493

    Full Changelog: https://github.com/bavix/laravel-wallet/compare/9.0.0-RC1...9.0.0-RC2

    Source code(tar.gz)
    Source code(zip)
  • 9.0.0-RC1(Apr 27, 2022)

  • 9.0.0-beta5(Apr 26, 2022)

  • 9.0.0-beta4(Apr 26, 2022)

    What's Changed

    • [8.4.1] deprecated Cart::getUniqueItems by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/486

    Full Changelog: https://github.com/bavix/laravel-wallet/compare/9.0.0-beta3...9.0.0-beta4

    Source code(tar.gz)
    Source code(zip)
  • 8.4.1(Apr 26, 2022)

  • 9.0.0-beta3(Apr 25, 2022)

  • 9.0.0-beta2(Apr 25, 2022)

    What's Changed

    • [9.x] Product custom price by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/485

    Full Changelog: https://github.com/bavix/laravel-wallet/compare/9.0.0-beta1...9.0.0-beta2

    Source code(tar.gz)
    Source code(zip)
  • 9.0.0-beta1(Apr 22, 2022)

    What's Changed

    • [9.x] Changing the logic of funds transfers by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/483

    Full Changelog: https://github.com/bavix/laravel-wallet/compare/9.0.0-alpha...9.0.0-beta1

    Source code(tar.gz)
    Source code(zip)
  • 9.0.0-alpha(Apr 22, 2022)

    What's Changed

    • [9.x] Split Product interface by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/474
    • [9.x] ExtraDtoInterface by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/479
    • [9.x] Eager loading by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/480
    • [9.x] PHP 8+ Union types by @rez1dent3 in https://github.com/bavix/laravel-wallet/pull/482

    Full Changelog: https://github.com/bavix/laravel-wallet/compare/8.4.0...9.0.0-alpha

    Source code(tar.gz)
    Source code(zip)
  • 8.4.0(Apr 20, 2022)

  • 8.3.0(Apr 15, 2022)

    Added

    • Added the ability to create custom events

    Removed

    • UnknownEventException

    Updated

    • Reduced the amount of memory consumed in the cart
    • Improved product returns performance
    Source code(tar.gz)
    Source code(zip)
  • 8.2.1(Apr 14, 2022)

  • 8.2.0(Apr 3, 2022)

  • 8.1.1(Mar 18, 2022)

  • 8.1.0(Mar 13, 2022)

    Removed

    • Method getAvailableBalance.

    Added

    • Methods withItems, withItem, withMeta on Cart-object.

    Deprecated

    • Method addItems, addItem, setMeta on Cart-Object.
    Source code(tar.gz)
    Source code(zip)
  • 8.0.6(Feb 25, 2022)

Owner
bavix
Sets of ready-made solutions, accelerate software development with us.
bavix
An easy-to-use virtual wallet implementation for Laravel.

Laravel Wallet Some apps require a prepayment system like a virtual wallet where customers can recharge credits which they can then use to pay in app

Muathye 1 Feb 6, 2022
Boilerplate code for protecting a form with proof of work. Uses javascript in the browser to generate the hashcash and PHP on the server to generate the puzzle and validate the proof of work.

Boilerplate code for protecting a form with proof of work. Uses javascript in the browser to generate the hashcash and PHP on the server to generate the puzzle and validate the proof of work.

Jameson Lopp 28 Dec 19, 2022
Postgis extensions for laravel. Aims to make it easy to work with geometries from laravel models.

Laravel Wrapper for PostgreSQL's Geo-Extension Postgis Features Work with geometry classes instead of arrays. $model->myPoint = new Point(1,2); //lat

Max 340 Jan 6, 2023
Loja virtual fictícia para compra de produtos e estilização dos mesmos. Desenvolvido com as tecnologias: HTML, CSS, PHP, CODEIGNITER, JavaScript, Bootstrap e Mysql.

StampGeek Loja virtual fictícia para compra de produtos e estilização dos mesmos. Desenvolvido com as tecnologias: HTML, CSS, PHP, CODEIGNITER, JavaSc

Pablo Silva 1 Jan 13, 2022
A simple wallet implementation for Laravel

Laravel Wallet A simple wallet implementation for Laravel. Installation You can install the package via composer: composer require stephenjude/laravel

Stephen Jude 216 Dec 29, 2022
A simple to use opinionated ERP package to work with Laravel

Laravel ERP A simple to use opinionated ERP package to work with Laravel Installation You can install the package via composer: composer require justs

Steve McDougall 16 Nov 30, 2022
An extended laravel eloquent WHERE method to work with sql LIKE operator.

Laravel Eloquent WhereLike An extended laravel eloquent WHERE method to work with sql LIKE operator. Inspiration The idea of this package comes from o

Touhidur Rahman 33 Aug 6, 2022
Laravel package to work with geospatial data types and functions.

Laravel Spatial Laravel package to work with geospatial data types and functions. For now it supports only MySql Spatial Data Types and Functions. Sup

Tarfin 47 Oct 3, 2022
This package allows you to easily work with NanoID in your Laravel models.

Laravel Model UUIDs Introduction Huge thanks to Micheal Dyrynda, whose work inspired me to create this package based on laravel-model-nanoid but uses

Parables Boltnoel 3 Jul 27, 2022
Localization Helper - Package for convenient work with Laravel's localization features and fast language files generation

Localization Helper Package for convenient work with Laravel's localization features and fast language files generation. Installation Via Composer $ c

Galymzhan Begimov 0 Jul 13, 2019
Laravel User Activity Log - a package for Laravel 8.x that provides easy to use features to log the activities of the users of your Laravel app

Laravel User Activity Log - a package for Laravel 8.x that provides easy to use features to log the activities of the users of your Laravel app

null 9 Dec 14, 2022
Laravel Breadcrumbs - An easy way to add breadcrumbs to your @Laravel app.

Introduction Breadcrumbs display a list of links indicating the position of the current page in the whole site hierarchy. For example, breadcrumbs lik

Alexandr Chernyaev 269 Dec 21, 2022
Laravel-FCM is an easy to use package working with both Laravel and Lumen for sending push notification with Firebase Cloud Messaging (FCM).

Laravel-FCM Introduction Laravel-FCM is an easy to use package working with both Laravel and Lumen for sending push notification with Firebase Cloud M

Rahul Thapa 2 Oct 16, 2022
Nebula is a minimalistic and easy to use administration tool for Laravel applications, made with Laravel, Alpine.js, and Tailwind CSS.

Nebula Nebula is a minimalistic and easy to use administration tool for Laravel applications, made with Laravel, Alpine.js, and Tailwind CSS. Nebula m

Nebula 228 Nov 11, 2022
Easy creation of slugs for your Eloquent models in Laravel

Eloquent-Sluggable Easy creation of slugs for your Eloquent models in Laravel. NOTE: These instructions are for the latest version of Laravel. If you

Colin Viebrock 3.6k Dec 30, 2022
Laravel Serializable Closure provides an easy way to serialize closures in PHP.

Serializable Closure Introduction This package is a work in progress Laravel Serializable Closure provides an easy way to serialize closures in PHP. I

The Laravel Framework 316 Jan 1, 2023
Larawiz is a easy project scaffolder for Laravel

Larawiz The Laravel 8 scaffolder you wanted but never got, until now! Use a single YAML file to create models, migrations, factories, seeders, pivot t

Larawiz 139 Aug 19, 2022
Easy-to-install Admin Panel for Laravel

CSS Framework: https://0notole.github.io/elements.css/ Install project: composer create-project --prefer-dist laravel/laravel screen, cd screen Add re

Anatoly Silko 3 Aug 25, 2021
A premade, easy to use local development setup to be used for authoring Laravel applications

Laravel Drydock This project is a premade, easy to use local development setup to be used for authoring Laravel applications. The deliverables of this

Alexander Trauzzi 19 Nov 11, 2022