leafs/inertia

Leaf PHP adapter for inertia JS
1,257 1
Install
composer require leafs/inertia
Latest Version:v4.3
PHP:^8.2
License:MIT
Last Updated:Aug 1, 2026
Links: GitHub  ·  Packagist
Maintainer: Mychi

Leaf + Inertia

This is a simple package that helps you use Inertia.js with Leaf. 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

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.

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

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.

Related Packages

inertia-studio/laravel-adapter

Server-driven admin panels for Laravel + Inertia.js. Define forms, tables, and p...

18 0
jecovier/laravel-inertia-routes

Automatically create routes for any inertia component.

11 0
vireo/framework

Modern PHP framework implementing Vertical Slice Architecture with Inertia.js in...

22 1
nytodev/inertia-bundle

Symfony Bundle implementing the Inertia.js v3 server-side protocol

1,585 19