An awesome laravel package made for adding login with MetaMask wallet option in your projects!
View Demo
·
Report Bug
·
Request Feature
Table of Contents
There are many great LOGIN packages available on GitHub. However, I didn't find one that really suited my needs in LARAVEL, so I created this enhanced one. I want to create a package for login with MetaMask so unique that it'll be the last one you ever need - I think this is it.
Here's why:
- Your time should be focused on creating something amazing. A project that solves a problem and helps others
- You shouldn't be doing the same tasks over and over like creating a Login page from scratch
- You should implement DRY principles to the rest of your life 😄
Of course, no one package will serve all projects since your needs may be different but what makes this package unique is the simplicity of the installation by adding just the script link to your blade as explaind below . So I'll be adding more in the near future. You may also suggest changes by forking this repo and creating a pull request or opening an issue. Thanks to all the people have contributed to expanding this package!
Read the rest to get started
Frameworks/libraries used to bootstrap your package.
In the few come lines, we will give you instructions about how to set up this repo inside your project so let's follow and enjoy this installation trip.
First in order to install this package inside your laravel project , so to do that we prefere using composer as explained below .
- composer
composer require ibrah3m/loginwithmetamsk
_Below is an explanation of how you should install and set up the package inside your app.
- add the package provider
At config/app.php put this line inside providers array Ibrah3m\LoginWithMetamsk\MetamaskServiceProvider::class,
- run the following in the command line
you will see a list of options select the below or 0 for all
php artisan vendor:publish
Tag: public
Here we go almost finsih , now you can use the package in different ways let's see each of them .
- by route
just visit the link below
http://www.example.com/CustomLoginPage
- by javascript plugin
inside your <HEAD> tag at login blade just put the following links to make the template render automatically
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>
<script type="text/javascript" src="{{route('metamask.plugin')}}">
- adding just the login button instead of the whole template
*find the package at vendor folder called "ibrah3m"
*inside the views folder go to file
"FrontJsHook.blade.php" comment line 12 "$("body").append(`@include('loginwithmetamsk::MetaMaskLoginTemplate')`);"
*now inside your login blade add login button by this line
<button class="btn btn-primary btn-block text-white btn-user" onClick="metamasklogin()" style="background: rgb(246,133,27);">MetaMask</button>
*In the end your blade will contain all of the below
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>
<script type="text/javascript" src="{{route('metamask.plugin')}}">
<button class="btn btn-primary btn-block text-white btn-user" onClick="metamasklogin()" style="background: rgb(246,133,27);">MetaMask</button>
For more examples, please refer to the Documentation
- Change Template Design
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Ibrahem Aljabr - @website
Project Link: https://github.com/ibrah3m/LoginWithMetamask