PHP code example of monkeyscloud / monkeyslegion-inertia
1. Go to this page and download the library: Download monkeyscloud/monkeyslegion-inertia 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/ */
monkeyscloud / monkeyslegion-inertia example snippets
use MonkeysLegion\Inertia\Inertia;
// In a controller
return Inertia::render('Dashboard', [
'user' => $user,
'stats' => $stats,
]);
$inertia = $container->get(Inertia::class);
$inertia->enableSsr('http://localhost:13714');
// Now all renders go through the Node.js SSR server
// Falls back to client-side rendering if SSR is unavailable