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

ActiveLibrary

alisacorporation/inertia-codeigniter
====================================

Inertia.js v3 server-side adapter for CodeIgniter 4. Build single-page apps with Vue 3 without the complexity of a REST API.

v0.1.0(yesterday)00MITPHPPHP ^8.2

Since Aug 25Pushed todayCompare

[ Source](https://github.com/alisacorporation/inertia-codeigniter)[ Packagist](https://packagist.org/packages/alisacorporation/inertia-codeigniter)[ Docs](https://github.com/alisacorporation/inertia-codeigniter)[ RSS](/packages/alisacorporation-inertia-codeigniter/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (5)Versions (2)Used By (0)

inertia-codeigniter
===================

[](#inertia-codeigniter)

[![CI](https://github.com/alisacorporation/inertia-codeigniter/actions/workflows/ci.yml/badge.svg)](https://github.com/alisacorporation/inertia-codeigniter/actions/workflows/ci.yml)[![Packagist Version](https://camo.githubusercontent.com/e6006b0663987eca823049381efd1d90ae8141a07a7cce8e761845fad0cf1684/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c697361636f72706f726174696f6e2f696e65727469612d636f646569676e697465722e737667)](https://packagist.org/packages/alisacorporation/inertia-codeigniter)[![PHP Version](https://camo.githubusercontent.com/4183faa0b4178d3f3bcf239905e0844be6b71f46a6188f8c3c3bd0b6bde5b5f2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f616c697361636f72706f726174696f6e2f696e65727469612d636f646569676e697465722e737667)](https://packagist.org/packages/alisacorporation/inertia-codeigniter)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](LICENSE)

**Inertia.js v3 server-side adapter for CodeIgniter 4.**

Build classic multi-page apps in CodeIgniter and hand your controllers' props straight to a Vue 3 client. No REST layer, no state duplication, no dedicated router.

```
use CodeIgniter\Inertia\Inertia;

return Inertia::render('Dashboard', [
    'user' => $user,
])->toResponse($this->request, $this->response);
```

```

defineProps()

        Welcome, {{ user.name }}

```

---

Table of contents
-----------------

[](#table-of-contents)

1. [Compatibility](#compatibility)
2. [Installation](#installation)
3. [Configuration](#configuration)
4. [Basic usage](#basic-usage)
5. [Shared props](#shared-props)
6. [Partial reloads](#partial-reloads)
7. [Lazy, optional, always, deferred and merge props](#prop-wrappers)
8. [Redirects](#redirects)
9. [Asset versioning](#asset-versioning)
10. [Vue 3 setup](#vue-3-setup)
11. [Vite setup](#vite-setup)
12. [Forms and validation](#forms-and-validation)
13. [Flash / session data](#flash--session-data)
14. [Security](#security)
15. [Testing](#testing)
16. [Server-side rendering (SSR)](#server-side-rendering-ssr)
17. [Deployment](#deployment)
18. [Troubleshooting](#troubleshooting)
19. [Protocol compatibility](#protocol-compatibility)
20. [Upgrade strategy](#upgrade-strategy)

---

Compatibility
-------------

[](#compatibility)

ComponentVerified versionPHP^8.2 (matches CI4 4.7.x)CodeIgniter 4^4.7Composer2.xInertia protocolv3`@inertiajs/vue3`^3.7Vue^3.5Vite^6 (7/8 also compatible via `@inertiajs/vue3` peers)Node≥ 20 (Vite 6 requirement)TypeScript^5.6The wire protocol is validated against the current [`@inertiajs/core`](https://github.com/inertiajs/inertia/tree/master/packages/core)master branch (`Page` type, `getInitialPageFromDOM`, response schema).

---

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

[](#installation)

### Backend

[](#backend)

```
composer require alisacorporation/inertia-codeigniter
```

That is enough. CodeIgniter's Composer auto-discovery registers:

- the `inertia` service (`service('inertia')`),
- the `inertia` filter alias (via `Config\Registrar`),
- the `inertia()` global helper.

### Frontend

[](#frontend)

Copy `resources/` from this repository into your CodeIgniter app (or adapt its contents into your existing frontend), then:

```
cd resources
npm install
npm run dev       # or `npm run build`
```

By default Vite writes hashed assets into `public/build/`. The default Inertia root view expects a manifest at `public/build/manifest.json`.

---

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

[](#configuration)

Publish a copy of the config into your app at `app/Config/Inertia.php`by extending the base class:

```
