Skip to content

Quick Start

We recommend scaffolding Inertia.js-Revamped via automatic CLI installer @preset/cli.

Inertia.js-Revamped is currently in alpha status and not ready for production use yet.

Try it Online

Start the Inertia.js-Revamped Breeze starter kit in your browser:

PHPSandbox Notebook

Prerequisites

Ensure that your environment meets the minimum installation requirements:

Scaffolding a new project

To install Inertia.js-Revamped in a fresh Laravel application, setup a new laravel project:

shell
composer create-project laravel/laravel <project-name>
cd <project-name>

Running the following command you'll be prompted to select your project configuration:

Click to expand available command line arguments
  • You can directly specify command line arguments.
OptionDescription
--pmPackage manager (default: npm) ("npm" | "pnpm" | "yarn" | "bun")
--uiUI-Framework ("preact" | "react" | "vue")
--templateTemplate ("default" | "breeze" | "pingcrm")
--no-ssrDisable SSR (default: false) (boolean)
--sandboxFor development workspace only (default: false) (boolean)
shell
npx @preset/cli apply inertiajs-revamped/inertia
shell
pnpm dlx @preset/cli apply inertiajs-revamped/inertia
shell
yarn add @preset/cli apply inertiajs-revamped/inertia
shell
bunx @preset/cli apply inertiajs-revamped/inertia

Example output:

shell
 OK  Applied Inertia.js-Revamped.

  Executed action: Choose your package manager pnpm
  Executed action: Choose your UI framework react
  Executed action: Choose your starter template breeze
  Executed action: Choose to enable/disable SSR enabled
  Executed action: Installing PHP dependencies with Composer (php)
  Executed action: Installing Breeze Scaffolding (15 actions)

 Presets  1 applied
 Actions  21 executed
Duration  21.55s

 NEXT STEPS

  Run the development server with npm run dev
  Edit your entry points in resources/application
  Edit your pages in resources/pages

Usage

Serving Laravel

To learn more about how to serve your Laravel application, read Laravel installation.

Typically, you may use a web server such as Apache or Nginx to serve your Laravel applications. If you ... would like to use PHP's built-in development server, you may use the serve Artisan command:

shell
php artisan serve

By default the HTTP-server will listen to port 8000.

Start the development server

Run the Vite dev server with the command:

shell
npm run dev
shell
pnpm run dev
shell
yarn run dev
shell
bun run dev
shell
# outputs
VITE v5.2.12  ready in 148 ms

  Local:   http://localhost:5173/
  Network: use --host to expose
  press h + enter to show help

LARAVEL v11.9.1  plugin v1.0.4

  APP_URL: http://localhost

Deploy

To learn more about how to deploy your application, read Laravel deployment.

Bundle with Vite

Build the app with production-ready assets with the command:

shell
npm run build:prod
shell
pnpm run build:prod
shell
yarn run build:prod
shell
bun run build:prod
shell
# outputs
vite v5.2.12 building for production...
 173 modules transformed.
public/build/manifest.json                         6.77 kB gzip:  0.83 kB
public/build/assets/main-COAaD1bI.css             18.35 kB gzip:  4.54 kB
# ...
public/build/assets/main-CkXGnkYC.js             252.00 kB gzip: 83.96 kB
 built in 1.40s
vite v5.2.12 building SSR bundle for production...
 29 modules transformed.
bootstrap/ssr/ssr-manifest.json                    2.48 kB
bootstrap/ssr/assets/index-VzRQPh_D.js             0.51 kB
# ...
bootstrap/ssr/assets/layout-C6sDMM8X.js           16.57 kB
 built in 344ms

Server-side Rendering (SSR)

Server-side rendering uses Node.js to render your pages in a background process; therefore, Node must be available on your server for server-side rendering to function properly.

shell
# start the ssr server
php artisan inertia:start-ssr

# stop the ssr server
php artisan inertia:stop-ssr

What's next?

Your contributions are welcome! Please read our contributing guide for more information.

Community

If you have a question or need additional help, please consider to join our Discord or start a discussion at GitHub.

Please use the GitHub issue tracker to submit bug reports and feature requests.