Lattice: Build Inertia UIs in PHP for Laravel | Mohamed Said        [  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png)   Mohamed Said Laravel Backend Engineer  ](https://msaied.com) [ Home ](https://msaied.com) [ Projects ](https://msaied.com/projects) [ Articles  ](https://msaied.com/articles) [ Certificates ](https://msaied.com/certificates) [ Contact ](https://msaied.com#contact-section) 

       [  ](https://github.com/EG-Mohamed)       

 [ Home ](https://msaied.com) [ Projects ](https://msaied.com/projects) [ Articles ](https://msaied.com/articles) [ Certificates ](https://msaied.com/certificates) [ Contact ](https://msaied.com#contact-section) 

  [ home ](https://msaied.com)    [ articles ](https://msaied.com/articles)    Lattice: Build Inertia UIs in Pure PHP Without Writing JSX        On this page       1. [  What Is Lattice? ](#what-is-lattice)
2. [  Pages as PHP Classes ](#pages-as-php-classes)
3. [  Forms Backed by Laravel Validation ](#forms-backed-by-laravel-validation)
4. [  Eloquent-Backed Tables ](#eloquent-backed-tables)
5. [  Actions and Client Effects ](#actions-and-client-effects)
6. [  Key Takeaways ](#key-takeaways)

  ![Lattice: Build Inertia UIs in Pure PHP Without Writing JSX](https://cdn.msaied.com/235/eab3e0fd6339f033e51100129b6ef132.png)

 [  Laravel ](https://msaied.com/articles?category=laravel) [  Composer Pacakge ](https://msaied.com/articles?category=composer-pacakge)  #Laravel   #Inertia.js   #Server-Driven UI   #PHP   #React   #Laravel Packages  

 Lattice: Build Inertia UIs in Pure PHP Without Writing JSX 
============================================================

     18 Jun 2026      3 min read    ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said  

       Table of contents

1. [  01   What Is Lattice?  ](#what-is-lattice)
2. [  02   Pages as PHP Classes  ](#pages-as-php-classes)
3. [  03   Forms Backed by Laravel Validation  ](#forms-backed-by-laravel-validation)
4. [  04   Eloquent-Backed Tables  ](#eloquent-backed-tables)
5. [  05   Actions and Client Effects  ](#actions-and-client-effects)
6. [  06   Key Takeaways  ](#key-takeaways)

 What Is Lattice?
----------------

Lattice is a server-driven UI framework for Laravel that lets you describe your entire frontend — pages, forms, tables, and actions — using fluent PHP classes. It serializes that component tree into a typed payload, ships it over Inertia.js as a normal page visit, and a single React component resolves each node against a registry to render it.

The server becomes the single source of truth for what a screen *is*. The client's only job is rendering it.

Pages as PHP Classes
--------------------

Every page extends a base `Page` class and carries an `#[AsPage]` attribute that registers its route automatically — no manual route entries needed. The UI is assembled in a `render()` method using fluent components like `Stack`, `Grid`, `Heading`, and `Card`:

```php
#[AsPage(route: '/dashboard', middleware: ['web'])]
final class DashboardPage extends BasePage
{
    public function render(PageSchema $schema): PageSchema
    {
        return $schema->schema([
            Stack::make('dashboard')
                ->gap(Gap::Large)
                ->schema([
                    Heading::make('Dashboard'),
                    Grid::make('stats')
                        ->columns(2)
                        ->schema([
                            Card::make('Orders', '128 this week.'),
                            Card::make('Revenue', '$4,210 this week.'),
                        ]),
                ]),
        ]);
    }
}

```

Route-model binding works directly in the `render()` signature, and an `authorize()` method gates access before the page renders.

Forms Backed by Laravel Validation
----------------------------------

Forms extend `FormDefinition`. Fields are declared in PHP with standard Laravel validation rules, and the `handle()` method runs on a successful submission. Dropping a form onto a page is a single fluent call:

```php
Form::use(ProfileForm::class)
    ->method(HttpMethod::Patch)
    ->submitLabel('Save changes')
    ->precognitive(500)
    ->fill(['name' => $user->name, 'email' => $user->email]);

```

Adding `->precognitive(500)` opts into live validation through Laravel Precognition with a 500 ms debounce.

Eloquent-Backed Tables
----------------------

Tables extend `EloquentTableDefinition`. You declare columns and return a query builder; sorting, filtering, and pagination are handled automatically based on which columns you mark as `sortable()` or `filterable()`:

```php
#[AsTable('app.products')]
class ProductsTable extends EloquentTableDefinition
{
    public function columns(): array
    {
        return [
            TextColumn::make('name')->sortable()->filterable(),
            NumberColumn::make('price')->sortable()->filterable(),
            BooleanColumn::make('featured'),
        ];
    }

    public function builder(TableQuery $query): Builder
    {
        return Product::query();
    }
}

```

Rendering it on a page uses the same `::use()` pattern as forms: `Table::use(ProductsTable::class)`.

Actions and Client Effects
--------------------------

Actions extend `ActionDefinition` and return an `ActionResult` carrying *effects* — instructions the client dispatches, such as a toast notification or a component reload:

```php
public function handle(Request $request): ActionResult
{
    $product = $this->product($request);
    $product->update(['status' => 'archived']);

    return ActionResult::success()
        ->toast(Variant::Success, 'Product archived.')
        ->reloadComponent('app.products');
}

```

Attached to a table row, the action carries the row's context to the server so `handle()` knows which record it's acting on.

Key Takeaways
-------------

- **Zero manual routes** — `#[AsPage]` registers routes automatically by scanning configured paths.
- **PHP-only UI authoring** — no JSX, no TypeScript component files for standard screens.
- **Laravel-native validation** — rules, Precognition live validation, and route-model binding all work as expected.
- **Eloquent tables out of the box** — sorting, filtering, and pagination are declared, not hand-coded.
- **Server-side effects** — actions return typed instructions (toast, redirect, reload) rather than views.

Lattice is open source. Full documentation, component reference, and theming options are available at [latticephp.com](https://latticephp.com/), and the source is on [GitHub](https://github.com/lattice-php/lattice).

---

*Source: [Lattice: Describe Inertia UIs in PHP — Laravel News](https://laravel-news.com/lattice-describe-inertia-uis-in-php)*

 Found this useful?

          [  ](https://twitter.com/intent/tweet?url=https%3A%2F%2Fmsaied.com%2Farticles%2Flattice-build-inertia-uis-in-pure-php-without-writing-jsx&text=Lattice%3A+Build+Inertia+UIs+in+Pure+PHP+Without+Writing+JSX) [  ](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fmsaied.com%2Farticles%2Flattice-build-inertia-uis-in-pure-php-without-writing-jsx) 

 Frequently Asked Questions 
----------------------------

  3 questions  

     Q01  Does Lattice require writing any React or JSX code?        No. Lattice lets you describe your entire UI — pages, forms, tables, and actions — using fluent PHP classes. The framework serializes the component tree and a single React component on the client resolves and renders each node automatically. 

      Q02  How does Lattice handle form validation?        Form fields are declared in PHP with standard Laravel validation rules. Lattice validates the request server-side and runs the `handle()` method on success. You can also opt into live validation by chaining `-&gt;precognitive(500)`, which uses Laravel Precognition with a debounce delay. 

      Q03  Do I need to register routes manually when using Lattice pages?        No. Adding the `#[AsPage]` attribute to a page class is enough. Lattice scans your configured paths and registers the route automatically, including support for route parameters and route-model binding. 

  Continue reading

 More Articles 
---------------

 [ View all    ](https://msaied.com/articles) 

 [ ![PhpStorm 2026.2 Released: Laravel Tool Window, PHP 8.5 Pipe Operator, and AI Agents](https://cdn.msaied.com/505/151a0bba66cc27064e090e69e55d7c92.png) PhpStorm JetBrains PHP 8.5 

### PhpStorm 2026.2 Released: Laravel Tool Window, PHP 8.5 Pipe Operator, and AI Agents

PhpStorm 2026.2 ships a dedicated Laravel tool window with Artisan, error logs, and Laravel Cloud tabs, plus P...

  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said 

 3 Aug 2026     3 min read  

  Read    

 ](https://msaied.com/articles/phpstorm-20262-released-laravel-tool-window-php-85-pipe-operator-and-ai-agents) [ ![Laravel Doctor: Diagnose Your Laravel App With One Artisan Command](https://cdn.msaied.com/504/d72224689abc7b396bce187535008272.png) Laravel Artisan Health Checks 

### Laravel Doctor: Diagnose Your Laravel App With One Artisan Command

Laravel Doctor is a first-party package announced at Laracon US 2026 that adds an `artisan doctor` command to...

  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said 

 3 Aug 2026     4 min read  

  Read    

 ](https://msaied.com/articles/laravel-doctor-diagnose-your-laravel-app-with-one-artisan-command) [ ![Livewire v4.3.5 Released: Fix for SFC Detection with PHP Attribute Array Arguments](https://cdn.msaied.com/503/9678ed8dbf5d7a6f4f19ca7694cf241b.png) Livewire Laravel PHP 

### Livewire v4.3.5 Released: Fix for SFC Detection with PHP Attribute Array Arguments

Livewire v4.3.5 ships a targeted bug fix for Single File Component (SFC) detection when PHP attributes contain...

  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said 

 3 Aug 2026     2 min read  

  Read    

 ](https://msaied.com/articles/livewire-v435-released-fix-for-sfc-detection-with-php-attribute-array-arguments) 

   [  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png)   Mohamed Said Laravel Backend Engineer  ](https://msaied.com)Senior Backend Engineer specializing in Laravel, scalable SaaS platforms, APIs, and cloud infrastructure. I build secure, high-performance web applications that help businesses grow.

Explore

- [Home](https://msaied.com)
- [Projects](https://msaied.com/projects)
- [Articles](https://msaied.com/articles)
- [Certificates](https://msaied.com/certificates)
- [Contact](https://msaied.com#contact-section)

Connect

- [   hello@msaied.com ](mailto:hello@msaied.com)
- [   +20 109 461 9204 ](tel:+201094619204)

© 2026 Mohamed Said. All rights reserved.

 [  ](https://github.com/EG-Mohamed) [  ](https://www.linkedin.com/in/msaiedm/) [  ](https://wa.me/201094619204) [  ](mailto:hello@msaied.com) [  ](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)
