Skip to main content

Laravel Breeze脚手架构建

技术栈
Laravel Breeze脚手架{ inertiajs中继,Tailwind样式库,前端(React(JS), Vue(HTML), Livewire(PHP)) },Shadcn组件库
composer global require laravel/installer
laravel new example-app
cd example-app
npm install && npm run build
composer run dev
#配置镜像源
npm config get registry
npm config set registry https://registry.npmmirror.com
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
诊断
composer diagnose
#解压
unzip "laravel-13.1.2.zip"
#进入
cd laravel
更新
composer update
#安装
composer install
#配置文件
cp .env.example .env
#生成应用密钥
php artisan key:generate
#迁移数据库
php artisan migrate

安装 Laravel Breeze
composer require laravel/breeze
使用 Breeze 安装 Inertia 脚手架Vue和React二选一
#Vue版本
php artisan breeze:install vue
#React版本
php artisan breeze:install react

安装前端
npm install
#监听实时更新,关闭终端就停止更新,需要按ctrl+c
npm run dev
#构建
npm run build

#Shadcn-vue 安装
npx shadcn-vue@latest add --all
npx shadcn-vue@latest init
npx shadcn-vue@latest add switch
文件√ You need to create a components.json file to add components. Proceed? ... yes
组件库√ Which component library would you like to use? » Reka UI
视觉风格√ Which visual style would you like to use? » Vega (Recommended)
Nova
Maia
Lyra
Mira
Luma
New York
Default
图标库√ Which icon library would you like to use? » Lucide
Tabler Icons
HugeIcons
Phosphor Icons
RemixIcon
字体√ Which font would you like to use? » Inter
Figtree
JetBrainsMono
Geist
Geist Mono
基础颜色√ Which color would you like to use as the base color? » Neutral
Gray
Zinc
Stone
Slate
目录\resources\js\Components\ui