la09r / web-fullstack-starter-kit-ui-vue-inertia
启动套件 Laravel UI Vue Inertia
10.1.8
2023-12-06 10:08 UTC
Requires
- php: ^8.1
- illuminate/support: ^10.32
- inertiajs/inertia-laravel: 0.6.11
- laravel/ui: 4.2.2
- tightenco/ziggy: 1.8.1
This package is auto-updated.
Last update: 2024-09-06 12:01:19 UTC
README
这是主包。所有UI的npm包都安装在这里。
要求
- Homestead 虚拟机
- 已安装并配置了命令行:PHP v. 8.1、Composer、Git
- 主机 机
- 已安装并配置了命令行:Node(JavaScript运行时环境) v. 18
安装
- 到 Homestead 虚拟机
- 更改目录到
DOCUMENT_ROOT:cd /home/vagrant/code/81/home/test/http/laravel/d rm -rf ./* && rm -rf ./.git && rm -rf ./.idea && rm -f ./.g* && rm -f ./.e* && rm -f ./.D*composer create-project laravel/laravel . "10.2.9"- 在
.env中设置APP_URL=http://d.laravel.test.home.81.local DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=d_laravel_test_home_81 DB_USERNAME=homestead DB_PASSWORD=secret - 创建
DB_DATABASE或删除DB_DATABASE中所有现有表 - 将 homestead.backend..sh 文件复制到
DOCUMENT_ROOT - 为 *.sh 文件更新 +x 权限
- 执行
homestead.backend.install.sh - 在
config/app.php的aliases中// add: App\Http\Controllers\Auth\LoginController::class => LA09R\StarterKit\UI\Vue\Inertia\App\Http\Controllers\Auth\LoginController::class, App\Providers\RouteServiceProvider::class => LA09R\StarterKit\UI\Vue\Inertia\App\Providers\RouteServiceProvider::class
- 在
config/app.php的providers中// comment: App\Providers\RouteServiceProvider::class, // add: LA09R\StarterKit\UI\Vue\Inertia\App\Providers\AppServiceProvider::class, LA09R\StarterKit\UI\Vue\Inertia\App\Providers\RouteServiceProvider::class,
- 在
app/Http/Kernel.php的protected $middleware array中// add: \LA09R\StarterKit\UI\Vue\Inertia\App\Http\Middleware\HandleInertiaRequests::class,
- 在
app/Http/Kernel.php中取消注释\Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
- 在
config/view.php的paths中删除所有并base_path('vendor/la09r/web-fullstack-starter-kit-ui-vue-inertia/src/resources/views'),
- 在
composer.json的autoload中添加"files": [ ".env.php" ]
- 在
composer.json中添加"minimum-stability": "dev", "prefer-stable": true, "repositories": [ ]
- 在 bash 中
php artisan tinker
User::factory()->create() // save: login = `email` field from tinker output, password = `password`
- 在 主机 机上
- 将 host.frontend..sh 文件复制到
DOCUMENT_ROOT - 为 *.sh 文件更新 +x 权限
- 将 host.frontend..sh 文件中的
#!/bin/zsh替换为您的 bash bin 路径 - 在 主机 机上执行
host.frontend.install.sh - 在
package.json的script.dev部分,将vite build --watch设置为 - 在
package.json的script.copy部分,将node ./vite.copy.componentsAsync.js设置为 - 在
vite.config.js的defineConfig.server.host部分,将Your_Homestead_IP设置为 - 执行
npm run dev并在浏览器中检查APP_URL