承接 mercuryseries/inertia-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mercuryseries/inertia-bundle

最新稳定版本:0.1.0

Composer 安装命令:

composer require mercuryseries/inertia-bundle

包简介

Enhanced Symfony adapter for Inertia.js.

README 文档

README

This is an enhanced Inertia.js server-side adapter based on rompetomp/inertia-bundle.

The inspiration and some of the API/code for this Bundle comes from the Laravel Inertia Adapter.

Installation

Make sure Composer is installed globally, as explained in the installation chapter of the Composer documentation.

Applications that use Symfony Flex

Open a command console, enter your project directory and execute:

$ composer require mercuryseries/inertia-bundle

Applications that don't use Symfony Flex

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

$ composer require mercuryseries/inertia-bundle

Step 2: Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles in the config/bundles.php file of your project:

// config/bundles.php

return [
    // ...
    MercurySeries\Bundle\InertiaBundle\MercurySeriesInertiaBundle::class => ['all' => true],
];

Step 3: Choose your stack

Add --ssr to any of the following options to add Server-side Rendering (SSR) support:

# React + Webpack Encore
$ symfony console inertia:install react --bundler=webpack

# React + Vite
$ symfony console inertia:install react --bundler=vite

# Vue + Webpack Encore
$ symfony console inertia:install vue --bundler=webpack

# Vue + Vite
$ symfony console inertia:install vue --bundler=vite

Step 4: Routes Configurations

Add the following route configuration if it's missing:

# config/routes.yaml

controllers:
    resource:
        path: ../src/Controller/
        namespace: App\Controller
    type: attribute
+   defaults:
+       csrf:
+           create: true
+           require:
+               - 'POST'
+               - 'PUT'
+               - 'PATCH'
+               - 'DELETE'

Step 5: Install packages and compile assets

# Install npm and run:
$ npm install

# Start the development server:
$ npm run dev-server

# Start coding into assets/js/pages/ 🎉

Production

# First you need to build both client and server bundles
$ npm run build

# Start/Stop the SSR Server
$ symfony console inertia:start-ssr
$ symfony console inertia:stop-ssr

统计信息

  • 总下载量: 130
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 9
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 9
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-05-29