Skip to content
Shesh Ghimire edited this page Jun 10, 2024 · 3 revisions

This library is an InertiaJS Adapter for PHP projects that uses implementation of PSR7 (HTTP Message Interface), PSR15 (Server Request Handlers), and optionally PSR11 (Container Interface).

Installation

Library

Install library using composer command:

$ composer require thewebsolver/inertia

Optional (but recommended Library)

This adapter comes with its own middleware that prepares the response header needed to convert the current Server request to an Inertia request. To do this, you need to follow the approach where middleware response headers are kept and sent to the next middleware.

This requirement is mandatory because when the ::handle() method of the Request Handler returns a response, it must include the headers of the Inertia Middleware's response. To achieve this, you may need to utilize the Pipeline library in your request handler. For more details, refer to the Pipeline Wiki Page.

$ composer require thewebsolver/pipeline
Clone this wiki locally