Git Product home page Git Product logo

laravel-wallet's Introduction

Hi there ๐Ÿ‘‹

  • ๐Ÿค“ I'm a freelance full-stack developer from Belgium ๐Ÿ‡ง๐Ÿ‡ช
  • ๐ŸŒฑ I'm currently working on @WinampAudio web platforms
  • ๐Ÿ› ๏ธ Sometimes I write on my blog
  • ๐Ÿ› ๏ธ I documented all the tools I use regularly on my /uses

Let's connect:

LinkedIn Twitter

Stack :

Laravel Remix Typescript Tailwind CSS SQLite

laravel-wallet's People

Contributors

abdelaziz321 avatar chadtomkiss avatar davidnadejdin avatar depsimon avatar kneazi2013 avatar tobeycodes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-wallet's Issues

How to get transaction detail right after deposit or withdraw ?

Hi,

This is amazing but it has no documentation for getting transaction detail, or make transaction status pending until successful payment done using payment gateway and then make it success

currently you are not returning transaction detail after creating transaction history in HasWallet.php

$this->wallet->transactions()
            ->create([
                'amount' => $amount,
                'hash' => uniqid('lwch_'),
                'type' => $type,
                'accepted' => $accepted,
                'meta' => $meta
            ]);

instead just add return

return $this->wallet->transactions()
            ->create([
                'amount' => $amount,
                'hash' => uniqid('lwch_'),
                'type' => $type,
                'accepted' => $accepted,
                'meta' => $meta
            ]);

so that we can get detail by,

        $transaction = $user->deposit(100, 'deposit', ['description' => 'Money Deposited to wallet.', 'status' => 'pending'], false);

transactions() relation includes transactions that are not accepted

Should $user->transactions() default to only include transactions that are accepted?

Similar to how Eloquent filters out soft deleted models, but you can use the withTrashed() to include ones that are deleted.

Maybe $user->transactions()->withRejected()->get() if you wanted every transaction or something?

Multiple Currencies

Hello,
Many many thanks for the amazing laravel package.
I am working with the project which is based on a reward system. A reward can be in points, BTC or USD so need your advice that which type of changes does this package require for the same.

Thanks!

actualBalance() should only include accepted Transactions

Issue:

When using the actualBalance() method in HasWallet, the amount doesn't match balance field on the wallets table as it includes transactions that weren't accepted

Should there be a where('accepted', 1) added to the query builder?

will race condition happen ?

Hi,

Can I know if I use the deposit or withdraw function is that possible race condition happen ?
let say a malicious user try to invoke withdraw function simultaneously, the wallet have balance of 10 and withdrawn 10 simultaneously , can both withdraw success ?

getting error while migration

hello, when i try to create migration it throws error

In Connection.php line 664:

  SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error i
  n your SQL syntax; check the manual that corresponds to your MySQL server v
  ersion for the right syntax to use near 'json null, `created_at` timestamp
  null, `updated_at` timestamp null) default cha' at line 1 (SQL: create tabl
  e `wallet_transactions` (`id` int unsigned not null auto_increment primary
  key, `wallet_id` int unsigned not null, `amount` int not null, `hash` varch
  ar(60) not null, `type` varchar(30) not null, `accepted` tinyint(1) not nul
  l, `meta` json null, `created_at` timestamp null, `updated_at` timestamp nu
  ll) default character set utf8mb4 collate 'utf8mb4_unicode_ci')


In Connection.php line 452:

  SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error i
  n your SQL syntax; check the manual that corresponds to your MySQL server v
  ersion for the right syntax to use near 'json null, `created_at` timestamp
  null, `updated_at` timestamp null) default cha' at line 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.