PHPackages                             leafs/inertia - 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. leafs/inertia

ActiveLibrary

leafs/inertia
=============

Leaf PHP adapter for inertia JS

v4.3(8mo ago)11.1k—0%2[1 PRs](https://github.com/leafsphp/inertia/pulls)MITPHP

Since Aug 11Pushed 8mo agoCompare

[ Source](https://github.com/leafsphp/inertia)[ Packagist](https://packagist.org/packages/leafs/inertia)[ Docs](https://leafphp.dev/modules/views/inertia/)[ GitHub Sponsors](https://github.com/leafsphp)[ Fund](https://opencollective.com/leaf)[ RSS](/packages/leafs-inertia/feed)WikiDiscussions v4.x Synced 1mo ago

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

 [![](https://camo.githubusercontent.com/d98ee5e32c2ff016fdfdac6c42654a908f4cc34b229c7b00caacc5a717455ae8/68747470733a2f2f6c6561667068702e6465762f6c6f676f2d636972636c652e706e67)](https://camo.githubusercontent.com/d98ee5e32c2ff016fdfdac6c42654a908f4cc34b229c7b00caacc5a717455ae8/68747470733a2f2f6c6561667068702e6465762f6c6f676f2d636972636c652e706e67)

Leaf + Inertia
==============

[](#leaf--inertia)

This is a simple package that helps you use [Inertia.js](https://inertiajs.com/) with [Leaf](https://leafphp.dev). It provides a `Inertia` class that makes it easy to return Inertia responses from your Leaf controllers and output Inertia template in your Leaf views.

Since Leaf supports multiple templating engines, inertia uses the engine configured in your view config.

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

[](#installation)

**Note: This is already done for you in Leaf MVC.**

Since this is the server-side adapter for Leaf, you need to install Inertia for whatever framework you're using on the client-side. You can find a list on the [Inertia website](https://inertiajs.com/).

```
npm install @inertiajs/react
```

After this, you can add the Leaf adapter to your project using the Leaf CLI:

```
leaf install inertia
```

Or with composer:

```
composer require leafs/inertia
```

Usage
-----

[](#usage)

To get started, you need replace your Leaf view with the Inertia component. In place of your default Leaf view, you should return the `Inertia::render` method. This method accepts the name of your component as its first argument, and an array of data as its second argument:

```
app()->get('/', function() {
    return Inertia::render('Home', [
        'name' => 'Leaf'
    ]);
});
```

**Full docs on [the leaf docs](https://leafphp.dev/modules/views/inertia/).**

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance60

Regular maintenance activity

Popularity21

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.9% 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 ~94 days

Recently: every ~40 days

Total

9

Last Release

250d ago

Major Versions

v0.1.0 → v4.02023-08-11

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/29547806?v=4)[Mychi](/maintainers/Mychi)[@mychi](https://github.com/mychi)

---

Top Contributors

[![mychidarko](https://avatars.githubusercontent.com/u/26604242?v=4)](https://github.com/mychidarko "mychidarko (31 commits)")[![phederal](https://avatars.githubusercontent.com/u/38112007?v=4)](https://github.com/phederal "phederal (1 commits)")

---

Tags

inertiareactvuesvelteleafPHP

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/leafs-inertia/health.svg)

```
[![Health](https://phpackages.com/badges/leafs-inertia/health.svg)](https://phpackages.com/packages/leafs-inertia)
```

###  Alternatives

[carbon/pipeline

Ultra-fast build stack for Neos CMS based on esbuild and PostCSS

1725.5k1](/packages/carbon-pipeline)[kiwilan/typescriptable-laravel

PHP package for Laravel to type Eloquent models, routes, Spatie Settings with autogenerated TypeScript. If you want to use some helpers with Inertia, you can install associated NPM package.

3920.9k](/packages/kiwilan-typescriptable-laravel)[tarunkorat/laravel-asset-cleaner

Safely detect and remove unused CSS, JS, SCSS and other assets from Laravel applications

733.2k1](/packages/tarunkorat-laravel-asset-cleaner)

PHPackages © 2026

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