承接 theamostafa/laravel-wallet 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

theamostafa/laravel-wallet

最新稳定版本:1.0.0

Composer 安装命令:

composer require theamostafa/laravel-wallet

包简介

This is my package laravel-wallet

README 文档

README

Light package help you to integrate wallet functionality into your laravel application

Installation

You can install the package via composer:

composer require theamostafa/laravel-wallet

You can publish and run the migrations with:

php artisan vendor:publish --tag="wallet-migrations"
php artisan migrate

Usage

include HasWallet trait into your model to apply wallet functions

use Theamostafa\Wallet\Traits\HasWallet;

class User extends Model {

  use HasWallet;

}

Now we make transactions.

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

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

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

You can also add metadata for transaction

$user = User::first();

$transaction = $user->withdraw(
        amount: 1.33,
        meta: [
            'description' => "Refund from order #14"
        ]
    );
    $transaction->description // Refund from order #14
 

Fetch all model transactions.

$user = User::first();

$user->transactions()->latest()->paginate(); 

Testing

composer test

Credits

Features coming with version 2

  • Model may be having multiple wallet
  • Wallet may be acted as payment gateway and can purchase products

License

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

统计信息

  • 总下载量: 273
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-07-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固