PHPackages                             mayvenstudios/flow-php-sdk - 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. [API Development](/categories/api)
4. /
5. mayvenstudios/flow-php-sdk

ActiveLibrary[API Development](/categories/api)

mayvenstudios/flow-php-sdk
==========================

PHP SDK for the Flow blockchain

0.3.3(2y ago)9215Apache-2.0PHP &gt;=7.0.0

Since Jun 4Compare

[ Source](https://github.com/mayvenstudios/flow-php-sdk)[ Packagist](https://packagist.org/packages/mayvenstudios/flow-php-sdk)[ RSS](/packages/mayvenstudios-flow-php-sdk/feed)WikiDiscussions Synced today

READMEChangelog (10)Dependencies (3)Versions (23)Used By (0)

Flow PHP SDK
============

[](#flow-php-sdk)

> ⚠️ This is an alpha release; functionality may change.

This is a Laravel PHP package that allows you to interact with the Flow blockchain by using the [Flow CLI](https://github.com/onflow/flow-cli).

In the future we'll make a full integration with the GRPC interface, but for now it's just a wrapper around the [Flow CLI](https://github.com/onflow/flow-cli).

At the moment, the SDK includes the following features:

- Wrapper around [Flow CLI](https://github.com/onflow/flow-cli) for basic scripts, transactions, events and block calls.
- *Communication with the [Flow Access API](https://docs.onflow.org/access-api) over gRPC (coming soon)*
- *Transaction preparation and signing (coming soon)*
- *Events parsing (coming soon)*

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

[](#installation)

### Composer

[](#composer)

To add this SDK to your project using Composer, use the following:

```
composer require mayvenstudios/flow-php-sdk

```

### Environment variables

[](#environment-variables)

After this, you should add the following variables in your .env file. This example shows the default Flow CLI path for macOS if you're using Homebrew, but on a Linux server it will likely be `~/.local/bin`

```
FLOW_PATH=/opt/homebrew/bin/
FLOW_NETWORK=testnet

```

### Cadence folder

[](#cadence-folder)

It's very important that you put all your flow.json config file and the contracts, scripts and transactions in a folder called `cadence` in the root directory of your project. This folder will be used as the base path to run the `flow` command, so that it will be able to read all the necessary Flow configurations.

### Config file (optional)

[](#config-file-optional)

If you're using Laravel you can also run this command to publish the config files if you need.

```
php artisan vendor:publish

```

### Install the grpc extension (optional)

[](#install-the-grpc-extension-optional)

This is only needed if you want to help develop the full GRPC version.

```
$ [sudo] pecl install grpc

```

Example Usage
-------------

[](#example-usage)

Once you have added the package via Composer and setup the environment variables, you can use the Flow Facade in the following ways.

Please remember to import the class at the beginning of your PHP with `use Flow;`

All the output will be returned as PHP Object parsed from the JSON returned by the Flow CLI.

### Get the latest Block

[](#get-the-latest-block)

```
Flow::getLatestBlock();

```

### Get the latest Block by ID

[](#get-the-latest-block-by-id)

```
Flow::getBlock(123456);

```

### Get Events within a range of Blocks (250 max)

[](#get-events-within-a-range-of-blocks-250-max)

```
Flow::event('event_name_with_address_goes_here')->minBlock(1)->maxBlock(100)->run();

```

### Run a script

[](#run-a-script)

```
Flow::script('path_to_cadence_script_file')->run();

```

### Execute a transaction

[](#execute-a-transaction)

```
Flow::transaction('path_to_cadence_transaction_file')->run();

```

Arguments
---------

[](#arguments)

You can easily pass arguments to the script and transactions by using the following methods

### Integer (UInt64)

[](#integer-uint64)

```
Flow::transaction('path_to_cadence_transaction_file')->argInt(100)->run();

```

### Fix (UFix64)

[](#fix-ufix64)

```
Flow::transaction('path_to_cadence_transaction_file')->argFix(9.99)->run();

```

### String

[](#string)

```
Flow::transaction('path_to_cadence_transaction_file')->argString('something')->run();

```

### Address

[](#address)

```
Flow::transaction('path_to_cadence_transaction_file')->argAddress('0x711eba2a0d39d21a')->run();

```

### Bool

[](#bool)

```
Flow::transaction('path_to_cadence_transaction_file')->argBool(true)->run();

```

### DictionaryString (Dictionary of {String:String})

[](#dictionarystring-dictionary-of-stringstring)

```
Flow::transaction('path_to_cadence_transaction_file')->argDictionaryString(['key' => 'value'])->run();

```

Contribution
------------

[](#contribution)

Project is in the very early phase, all contributions are welcomed.

Read the [contributing guide](https://github.com/mayvenstudios/flow-php-sdk/blob/main/CONTRIBUTING.md) to get started.

Dependencies
------------

[](#dependencies)

[Protobuf-PHP](https://github.com/drslump/Protobuf-PHP)[Illuminate-Support](https://github.com/illuminate/support)

License
-------

[](#license)

[Apache License 2.0](http://www.apache.org/licenses/)

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 69.2% 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.

###  Release Activity

Cadence

Every ~41 days

Recently: every ~1 days

Total

22

Last Release

987d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3e3a5a4fb92fa92464e5571ac81a1b0c53980cac20987242422b5b7544021976?d=identicon)[lucamayven](/maintainers/lucamayven)

---

Top Contributors

[![luca-mayven](https://avatars.githubusercontent.com/u/53099518?v=4)](https://github.com/luca-mayven "luca-mayven (18 commits)")[![crash13override](https://avatars.githubusercontent.com/u/1100260?v=4)](https://github.com/crash13override "crash13override (6 commits)")[![bluesign](https://avatars.githubusercontent.com/u/1119338?v=4)](https://github.com/bluesign "bluesign (2 commits)")

### Embed Badge

![Health badge](/badges/mayvenstudios-flow-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/mayvenstudios-flow-php-sdk/health.svg)](https://phpackages.com/packages/mayvenstudios-flow-php-sdk)
```

###  Alternatives

[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k95.4M306](/packages/laravel-horizon)[illuminate/queue

The Illuminate Queue package.

21332.6M1.6k](/packages/illuminate-queue)[illuminate/console

The Illuminate Console package.

13046.0M6.5k](/packages/illuminate-console)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45444.2k1](/packages/pressbooks-pressbooks)[illuminate/process

The Illuminate Process package.

44869.2k99](/packages/illuminate-process)

PHPackages © 2026

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