PHPackages                             mylesdc/laravel-ethereum - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. mylesdc/laravel-ethereum

ActiveLibrary

mylesdc/laravel-ethereum
========================

the ethereum json rpc api

2821PHP

Since Mar 13Pushed 5y agoCompare

[ Source](https://github.com/mylesdc/laravel-ethereum)[ Packagist](https://packagist.org/packages/mylesdc/laravel-ethereum)[ RSS](/packages/mylesdc-laravel-ethereum/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (1)

 Ethereum Package for Laravel
------------------------------

[](#----ethereum-package-for-laravel)

 [![Latest Stable Version](https://camo.githubusercontent.com/af9c2cc076e3735b4da7bf234a24576397ee6ba71b3ab9b21c6d35a33983e1bb/68747470733a2f2f706f7365722e707567782e6f72672f6d796c657364632f6c61726176656c2d657468657265756d2f762f737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/mylesdc/laravel-ethereum) [![Latest Unstable Version](https://camo.githubusercontent.com/ac492896d949451305a8d8d969e8b6a5d4faca2dcfe0344076d5df1ef3ce6d46/68747470733a2f2f706f7365722e707567782e6f72672f6d796c657364632f6c61726176656c2d657468657265756d2f762f756e737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/mylesdc/laravel-ethereum) [![License](https://camo.githubusercontent.com/7ba2548c45163548af61505e9bb10dad5dbb75f72981babee1b12e1535bd49e5/68747470733a2f2f706f7365722e707567782e6f72672f6d796c657364632f6c61726176656c2d657468657265756d2f6c6963656e73653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/mylesdc/laravel-ethereum) [![Total Downloads](https://camo.githubusercontent.com/7ef3c39e0b3ee701052e49442ae9d384a9c1426834a2856d939d869744192476/68747470733a2f2f706f7365722e707567782e6f72672f6d796c657364632f6c61726176656c2d657468657265756d2f646f776e6c6f616473)](https://packagist.org/packages/mylesdc/laravel-ethereum)

Introduction
------------

[](#introduction)

This is a simple Laravel Service Provider providing for [Generic JSON RPC](https://github.com/ethereum/wiki/wiki/JSON-RPC)

and [Management API](https://github.com/ethereum/go-ethereum/wiki/Management-APIs)

Installation
------------

[](#installation)

To install the PHP client library using Composer:

```
composer require mylesdc/laravel-ethereum
```

Alternatively, add these two lines to your composer require section:

```
{
    "require": {
        "mylesdc/laravel-ethereum": "dev-master"
    }
}
```

### Laravel 5.5+

[](#laravel-55)

If you're using Laravel 5.5 or above, the package will automatically register the `Ethereum` provider and facade.

### Laravel 5.4 and below

[](#laravel-54-and-below)

Add `Mylesdc\LaravelEthereum\EthereumServiceProvider` to the `providers` array in your `config/app.php`:

```
'providers' => [
    // Other service providers...

    Mylesdc\LaravelEthereum\EthereumServiceProvider::class,
],
```

If you want to use the facade interface, you can `use` the facade class when needed:

```
use Mylesdc\LaravelEthereum\Facade\Ethereum;
```

Or add an alias in your `config/app.php`:

```
'aliases' => [
    ...
    'Ethereum' => Mylesdc\LaravelEthereum\Facade\Ethereum::class,
],
```

### Using Laravel-Ethereum with Lumen

[](#using-laravel-ethereum-with-lumen)

laravel-ethereum works with Lumen too! You'll need to do a little work by hand to get it up and running. First, install the package using composer:

```
composer require mylesdc/laravel-ethereum
```

Next, we have to tell Lumen that our library exists. Update `bootstrap/app.php`and register the `EthereumServiceProvider`:

```
$app->register(Mylesdc\LaravelEthereum\EthereumServiceProvider::class);
```

Finally, we need to configure the library. Unfortunately Lumen doesn't support auto-publishing files so you'll have to create the config file yourself by creating a config directory and copying the config file out of the package in to your project:

```
mkdir config
cp vendor/mylesdc/laravel-ethereum/config/ethereum.php config/ethereum.php
```

At this point, set `ETH_HOST` and `ETH_PORT` in your `.env` file and it should be working for you. You can test this with the following route:

```
try{
        $ret = \Mylesdc\LaravelEthereum\Facade\Ethereum::eth_protocolVersion();
        print_r($ret);
    }catch (Exception $e){
        echo $e->getMessage();
    }
```

Configuration
-------------

[](#configuration)

You can use `artisan vendor:publish` to copy the distribution configuration file to your app's config directory:

```
php artisan vendor:publish
```

Then update `config/ethereum.php` with your credentials. Alternatively, you can update your `.env` file with the following:

```
ETH_HOST=http://localhost
ETH_PORT=8545
```

Usage
-----

[](#usage)

To use the Ethereum Client Library you can use the facade, or request the instance from the service container:

```
try{
        $ret = \Mylesdc\LaravelEthereum\Facade\Ethereum::eth_protocolVersion();
        print_r($ret);
    }catch (Exception $e){
        echo $e->getMessage();
    }
```

Or

```
$thereum = app('Ethereum');

$result=$thereum->eth_protocolVersion();
```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 Bus Factor1

Top contributor holds 63.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1a2fa4d72905b9bd03ea91c1112db2a2f4adc21d38b5ff203aaa340645475c3f?d=identicon)[mabuie](/maintainers/mabuie)

---

Top Contributors

[![mylesdc](https://avatars.githubusercontent.com/u/3400621?v=4)](https://github.com/mylesdc "mylesdc (7 commits)")[![jcsofts](https://avatars.githubusercontent.com/u/33087222?v=4)](https://github.com/jcsofts "jcsofts (4 commits)")

### Embed Badge

![Health badge](/badges/mylesdc-laravel-ethereum/health.svg)

```
[![Health](https://phpackages.com/badges/mylesdc-laravel-ethereum/health.svg)](https://phpackages.com/packages/mylesdc-laravel-ethereum)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
