Send your laravel apps to the moon with web3 enabled ๐Ÿš€

Overview

Laravel Web3 ๐Ÿš€ ๐ŸŒ

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/[email protected]/dist/index.js"
    ></script>
    <script
        type="text/javascript"
        src="https://unpkg.com/@walletconnect/[email protected]/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.

You might also like...
Laravel Plans is a package for SaaS apps that need management over plans, features, subscriptions, events for plans or limited, countable features.

Laravel Plans Laravel Plans is a package for SaaS apps that need management over plans, features, subscriptions, events for plans or limited, countabl

Fly50W is a new language which helps you build simple apps using more than 500k lines of code easily.

Fly50W is a new language which helps you build simple apps using more than 500k lines of code easily. Installation

Demo Silverstripe and JavaScript sources for Lightning Talk
Demo Silverstripe and JavaScript sources for Lightning Talk "FormField Mini Apps" at StripeCon EU 2022

Watch the Lightning Talk on Youtube ๐Ÿ“บ Demo repository for Lightning Talk "FormField Mini Apps with the JavaScript framework/lib/style of your choice"

Laravel & MySQL, jQuery, Ajax, Bootstrap. Also, it's include email send function without any API.
Laravel & MySQL, jQuery, Ajax, Bootstrap. Also, it's include email send function without any API.

Rewards-Dacor Laravel & MySQL, jQuery, Ajax, Bootstrap. Also, it's include email send function without any API. [Live site link] ( https://rewardsdaco

Package to send customer specific prices to Magento from a Laravel application using a configurable source.

Laravel Magento Customer Prices This package provides a way to add customer specific prices to Magento from a Laravel app. By default, it uses the Mag

Package to send prices to Magento from a Laravel application using a configurable source.

Laravel Magento Prices Package to send prices to Magento from a Laravel application using a configurable source. Features The idea is that we want to

โšก๏ธ A WordPress plugin to quickly send a 404 for missing static files

Static 404 A WordPress plugin to quickly send a 404 for missing static files. Quickly output a 404 for static files that aren't found, rather than loa

A Kimai 2 plugin, which send duration of cards to GitLab spend issues of timesheet.
A Kimai 2 plugin, which send duration of cards to GitLab spend issues of timesheet.

GitLabBundle A Kimai 2 plugin, which send duration of cards to GitLab spend issues of timesheet. Installation First clone it to your Kimai installatio

Send tokens using PHP

Waiting vs Not Waiting The $transactionCount obtained by calling getTransactionCount() is only accurate if ALL the previously submitted transactions h

Comments
  • [feature] custom 'account' column name

    [feature] custom 'account' column name

    Maybe it can be useful if the account column name can be changed from the config file (+ .env).

    In our case, we already use the accountname for other purposes

    opened by imClement 2
  • WalletConnectProvider not working / LaravelWeb3Scripts.php file

    WalletConnectProvider not working / LaravelWeb3Scripts.php file

    constructor() { this._provider = null; this.reloadAfterFetching = true; this.alertUserIfMetamaskIsNotInstalled = true; this.contracts = @json(config('web3.contracts')); this.web3ModalOptions = { cacheProvider: true, disableInjectedProvider: false, providerOptions: { walletconnect: { package: WalletConnectProvider, options: { infuraId: "******* // hidden for post", qrcodeModalOptions: { desktopLinks: [ 'ledger', 'tokenary', 'wallet', 'wallet 3', 'secuX', 'ambire', 'wallet3', 'apolloX', 'zerion', 'sequence', 'punkWallet', 'kryptoGO', 'nft', 'riceWallet', 'vision', 'keyring' ], mobileLinks: [ "rainbow", "metamask", "trust", ], }, }, }, }, }; }

    Error: console log / Developer tools

    Uncaught (in promise) TypeError: e is not a constructor at walletconnect.ts:31:22 at tslib.es6.js:100:1 at Object.next (tslib.es6.js:81:45) at tslib.es6.js:74:1 at new Promise () at Module.A (tslib.es6.js:70:1) at walletconnect.ts:15:44 at new Promise () at t.default (walletconnect.ts:15:10) at e. (providers.ts:201:30)

    opened by A-M-H-F 1
  • [warning] We ge this error message for Elliptic\Curve\ShortCurve\Point

    [warning] We ge this error message for Elliptic\Curve\ShortCurve\Point

    Hi,

    We get this warning in the log :Return type of Elliptic\Curve\ShortCurve\Point::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/simplito/elliptic-php/lib/Curve/ShortCurve/Point.php on line 84

    opened by imClement 5
  • [feature] Separate sign-up and sign-in logics

    [feature] Separate sign-up and sign-in logics

    In our use case we do not want to allow users to directly sign-up with their MM but we want to provide them with the ability to add their MM to the existing account and be able to sign-in with it.

    opened by imClement 0
Releases(1.0.0)
Owner
Ricardo Sawir
Full-stack developer, specializing in making enterprise-grade app. Open to work remotely worldwide.
Ricardo Sawir
Thirdweb-wp - A community WordPress plugin for thirdweb. Turn your WordPress website into Web3 instantly and easily with thirdweb. ๐Ÿ’ป๐ŸŒ

Thirdweb WP ?? Nominate (@WarenGonzaga) as GitHub Star. If you appreciate his hardwork and dedication to open source. A community WordPress plugin for

Waren Gonzaga 8 Dec 19, 2022
EBook-Apps - The eBook Apps is a web application that helps you browse ebooks from anywhere using your smartphone and laptop.

โšก๏ธ eBook Apps The eBook Apps is a web application that helps you browse ebooks from anywhere using your smartphone and laptop. ?? Getting Started To s

Ahmad Fauzy 32 Nov 14, 2022
โš™๏ธ Web3 PHP CLI is a blazing fast blockchain server for local development.

Web3 PHP CLI is a blazing fast blockchain server for local development. This project is a work-in-progress. Code and documentation are currently under

Web3 PHP 139 Jan 6, 2023
A Laravel Wrapper for the Binance API. Now easily connect and consume the Binance Public & Private API in your Laravel apps without any hassle.

This package provides a Laravel Wrapper for the Binance API and allows you to easily communicate with it. Important Note This package is in early deve

Moinuddin S. Khaja 7 Dec 7, 2022
Prepare your Laravel apps incredibly fast, with various commands, services, facades and boilerplates.

Grafite Builder Grafite has archived this project and no longer supports or develops the code. We recommend using only as a source of ideas for your o

Grafite Inc 997 Dec 22, 2022
Venture allows you to create and manage complex, async workflows in your Laravel apps.

Venture is a package to help you build and manage complex workflows of interdependent jobs using Laravel's queueing system. Installation Note: Venture

Kai Sassnowski 680 Dec 14, 2022
๐Ÿšฆ Viewi PHP integration for your Leaf apps

Leaf Viewi Module This module allows you to quickly and easily integrate Viewi into your Leaf apps without any pain at all. Installation You can easil

Leaf Framework 4 Aug 21, 2022
๐ŸŽฎ A simple command line tool for installing and interacting with your leaf apps

Leaf CLI 2 A simple command line tool for creating and interacting with your leaf projects. You can do stuff like installing packages, interacting wit

Leaf Framework 7 Aug 24, 2022
Ask your friends to send you an anonymous message without knowing them

Ask your friends to send you an anonymous message without knowing them. ????????

Siavash 1 Apr 16, 2022