Download the PHP package neoisrecursive/inertia-tempest without Composer
On this page you can find all versions of the php package neoisrecursive/inertia-tempest. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download neoisrecursive/inertia-tempest
More information about neoisrecursive/inertia-tempest
Files in neoisrecursive/inertia-tempest
Package inertia-tempest
Short Description A inertia adapter for the tempestphp framework
License MIT
Informations about the package inertia-tempest
Inertia tempest
installation
Setup
It should be very familiar if you have used inertia before, with some small differences, for example:
- No configuration is done in the middleware, use the the config file, a provider class or your own middleware to set your "globally-shared-props".
- No automatic redirect back handling in non get requests, since all tempest routes must return a response you have to return your own
Backresponse. - Includes all validation errors for each field by default, instead of just the first one.
We provide an installer that you can use to set up some of the boilerplate code, but you can also do it manually.
Installer
First run the tempest vite installer (the inertia installer assumes you use vite):
Then you can run the inertia installer:
Then all you have to do is to follow the instructions in the terminal. The only manual step is to add the vite plugin for your fe-framework to the vite config file.
Manual setup
If you don't want to use the installer, you can do the following steps manually:
Backend
If you use the default config, a view called app.view.php is required. That view will then be rendered as an NeoIsRecursive\Inertia\Views\InertiaBaseView and to render the inertia element you just do:
Frontend
Install the bundler of your choice, since tempest comes with a vite installer, that is very much recommended. Tempest vite docs.
When that is done, you can go on to install your prefered inertia client by following the guide on inertia's official site here
Usage
It is pretty similar to the Laravel adapter, except that to return an Inertia respone, you return a Component instance - like in your other Tempest routes.
Configuration
This is the default config: