With this package you can create wallet for the users.

Overview

Laravel User Wallet

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads


With this package you can create wallet for the users.

Note: Make sure you've already installed php ^8

Installation

Install the package via composer:

composer require mahbodhastam/laravel-user-wallet

Usage

  • Create New Wallet

use MahbodHastam\UserWallet\UserWallet;

$wallet = UserWallet::createNewWallet(user_id: 1);

$amount = $wallet->amount;
$token = $wallet->token;
  • Get wallet with the token/id

$wallet = UserWallet::getWallet('abc');
  • Get wallet's balance

$balance = UserWallet::balance($wallet)['total'];
  • Change wallet's amount

UserWallet::fill($wallet, 100);
  • Charge the wallet

UserWallet::charge($wallet, 500);
  • Send

UserWallet::send(
    sender: $wallet1,
    receiver: $wallet2,
    value: 50
);
  • Open a request

$transaction = UserWallet::makeRequest(
    value: 300,
    receiver: $wallet
);

// Keep it
$hash = $transaction->transaction_hash;

UserWallet::closeRequest(
    sender: $wallet,
    transaction_hash: $hash
);

See the Tests for more examples.

Testing

composer test

Todos

  • Blade Directives

Changelog

See CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

License

The MIT License (MIT). Please see License File for more information.

You might also like...
Users Management for extension user.
Users Management for extension user.

Template for Yii Packages Installation composer require vendor/your-packages Unit testing The package is tested with PHPUnit. To run tests: ./vendor

LittleLink Custom provides you with a website similar to Linktree. Many social media platforms only allow you to add one link
LittleLink Custom provides you with a website similar to Linktree. Many social media platforms only allow you to add one link

LittleLink Custom is a fork of LittleLink Admin with a set goal of making the admin panel easier to use and setup, for inexperienced and first-time users, with the addition of many custom features themed around customization for the individual user's, LittleLink pages.

Kick-start laravel prepared package for you!

Laravel Platform Install For development composer install npm install npm run dev ?? npm run prod php artisan migrate --seed For testing composer ins

A Laravel package which helps you automate creation of files.
A Laravel package which helps you automate creation of files.

Laravel file generator This is a Laravel package which helps you automate creation of files. High Res Link Benefits If you create a type of file frequ

Nue Boilerplate - A package for those of you who are tired of coding
Nue Boilerplate - A package for those of you who are tired of coding

Nue Boilerplate Baca Dokumentasi Disini Screenshot Documentation Requirements Installation Configuration Components Alert License Requirements Laravel

LaraAdmin is a Open source Laravel Admin Panel / CMS which can be used as Admin Backend, Data Management Tool or CRM boilerplate for Laravel with features like Advanced CRUD Generation, Module Manager, Backups and many more.
LaraAdmin is a Open source Laravel Admin Panel / CMS which can be used as Admin Backend, Data Management Tool or CRM boilerplate for Laravel with features like Advanced CRUD Generation, Module Manager, Backups and many more.

LaraAdmin 1.0 LaraAdmin is a Open source CRM for quick-start Admin based applications with features like Advanced CRUD Generation, Schema Manager and

A Laravel 5.8 API Boilerplate to create a ready-to-use REST API in seconds.

Laravel API Boilerplate (JWT Edition) for Laravel 5.8 Laravel API Boilerplate is a "starter kit" you can use to build your first API in seconds. As yo

FacEssential is a Core for PMMP, it gathers all kind of plugins needed to create a faction server. It was created from scratch by Clouds#0667.
FacEssential is a Core for PMMP, it gathers all kind of plugins needed to create a faction server. It was created from scratch by Clouds#0667.

FacEssential FacEssential is a Core for PMMP, it gathers all kind of plugins needed to create a faction server. It was created from scratch by Clouds#

 Easiest way to create beautiful administration backends with Symfony.
Easiest way to create beautiful administration backends with Symfony.

☂ Umbrella framework Easiest way to create beautiful administration backends with Symfony. Demo website • Demo repository Create a new project with Um

Releases(v1.1.1)
Owner
Mahbod Ahmadi
Web Developer
Mahbod Ahmadi
Create (passwordless) login links for users

Generate login links for users Login links for Laravel is a package for Laravel 6, 7 and 8 that allows users to easily log in with a (one-time) login

null 13 Mar 29, 2022
Admin Columns allows you to manage and organize columns in the posts, users, comments, and media lists tables in the WordPress admin panel.

Admin Columns allows you to manage and organize columns in the posts, users, comments, and media lists tables in the WordPress admin panel. Transform the WordPress admin screens into beautiful, clear overviews.

Codepress 67 Dec 14, 2022
Boilerplate between the Magento API and ImportExport, so that you can do fast Array/XMLRPC/SOAP based product imports.

Boilerplate between the Magento API and ImportExport, so that you can do fast Array/XMLRPC/SOAP based product imports.

Daniel Sloof 249 May 30, 2022
Very simple CRUD project, written in pure php. Designed as framework-agnostic as possible, and with basically no stack overflow if you can believe that

briefly simple CRUD pure php project for self improvement I try to make it purely in github - not only code, but any documentation (wiki), tasks (issu

Michał Jędrasiak 1 Jan 23, 2022
Mazer is a Admin Dashboard Template that can help you develop faster. We bring Mazer with Laravel starter project.

Mazer is a Admin Dashboard Template that can help you develop faster. We bring Mazer with Laravel starter project. It's completely free and you can use it in your projects.

Saugi 118 Dec 20, 2022
Api first backend boilerplate build with laravel 🎯 you can use as a template 😉

Laravel Backend Template i use this as a starting point for my backend projects , it saves time with basic auth functionalities and has code examples

Hijen EL Khalifi 4 Nov 14, 2022
This package adds artisan commands to create VueJS components and InertiaJS components.

Laravel Vue Commands This package adds artisan commands to create VueJS components and InertiaJS components. Installation You can install the package

ArielMejiaDev 3 Sep 10, 2021
a laravel package to create dynamically dashboard views in several templates ( in development)

Laravel Dashboarder A laravel package for generate admin dashboard dynamically based on Tabler template use livewire - alpinejs Installation Run the c

Laravel Iran Community 7 Dec 12, 2022
:elephant: A Laravel 6 SPA boilerplate with a users CRUD using Vue.js 2.6, GraphQL, Bootstrap 4, TypeScript, Sass, and Pug.

Laravel Vue Boilerplate A Laravel 6 Single Page Application boilerplate using Vue.js 2.6, GraphQL, Bootstrap 4, TypeScript, Sass and Pug with: A users

Alefe Souza 533 Jan 3, 2023
A very simple admin panel for managing users, roles & permissions.

Laravel Admin Starter A very simple admin panel for managing users, roles & permissions. The premise for this package is to eradicate the duplicate wo

James Mills 26 Sep 24, 2022