PHP code example of neoisrecursive / inertia-tempest

1. Go to this page and download the library: Download neoisrecursive/inertia-tempest library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

neoisrecursive / inertia-tempest example snippets


<x-inertia />

use Tempest\Http\Get;
use NeoIsRecursive\Inertia\Http\Component;

final class ReviewController
{
    #[Get(uri: '/reviews/{review}')]
    public function show(Review $review): Component
    {
        return new Component('reviews/show', [
            'review' => $review,
        ]);
    }
}



use NeoIsRecursive\Inertia\DefaultSharedPropResolver;
use NeoIsRecursive\Inertia\InertiaConfig;
use NeoIsRecursive\Inertia\ManifestVersionResolver;

use function Tempest\root_path;

return new InertiaConfig(
    /**
     * The view that inertia should render on the first request
     */
    rootView: 'app.view.php',
    /**
     * Version resolver, if you use vite for example you probably want to use the default here,
     * or you can add a custom one to maybe get from enviroment variables etc.
     *
     * default path: public/build/manifest.json
     */
    versionResolver: new ManifestVersionResolver(),
    /**
     * Props that should be