承接 sawirricardo/laravel-web3 相关项目开发

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

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

sawirricardo/laravel-web3

Composer 安装命令:

composer require sawirricardo/laravel-web3

包简介

Send your laravel apps to the moon with web3 enabled 🚀

README 文档

README

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

Laravel Web3 helps you to kickstart your web3 apps.

  • No more headache with handling wallet changing address and sync with laravel back-end.
  • Just do it
  • Really, just do the steps below and be done.

Support this

Investing on Laravel-Web3 is defintely a good move from you. You can support by donating to my wallet

Installation

You can install the package via composer:

composer require sawirricardo/laravel-web3

You can publish and run the migrations with:

php artisan vendor:publish --provider="Sawirricardo\LaravelWeb3\LaravelWeb3ServiceProvider" --tag="laravel-web3-migrations"
php artisan migrate

You can publish the config file with:

php artisan vendor:publish --provider="Sawirricardo\LaravelWeb3\LaravelWeb3ServiceProvider" --tag="laravel-web3-config"

This is the contents of the published config file:

return [
  'network' => env('WEB3_NETWORK', 'localhost'),
  'infura_id' => env('WEB3_INFURA_ID', ''),
];

Add this to your .env

WEB3_NETWORK=localhost #mainnet, mumbai, etc
WEB_INFURA_ID=xxxxxxxxxxxxxxxxxx
MIX_WEB3_NETWORK="${WEB3_NETWORK}"
MIX_WEB3_INFURA_ID="${WEB_INFURA_ID}"

Then, add "account" to \App\Models\User fillables

// app/Models/User.php
protected $fillable = [
  'email','name','password',
  'account' //Add this
];

Also add this to your layout HTML

<body>
    <!-- it's best to drop this at the below -->
    <script
        src="https://cdn.ethers.io/lib/ethers-5.2.umd.min.js"
        type="application/javascript"
    ></script>
    <script
        type="text/javascript"
        src="https://unpkg.com/web3modal@1.9.0/dist/index.js"
    ></script>
    <script
        type="text/javascript"
        src="https://unpkg.com/@walletconnect/web3-provider@1.6.5/dist/umd/index.min.js"
    ></script>
    <x-laravelweb3Scripts />
</body>

Usage

@guest
<button onclick="laravelWeb3.onConnect()">Connect to wallet</button>
@endguest

@auth
<button onclick="laravelWeb3.onDisconnect()">Disconnect wallet</button>
@endauth
// return provider object by Ethers JS
// Run wild, my friends
const etherProvider = laravelWeb3.getProvider();

// LaravelWeb3 automatically register laravelWeb3 to window object for you to play.
console.log({window.laravelWeb3});

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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

统计信息

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

GitHub 信息

  • Stars: 21
  • Watchers: 4
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-10-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固