外观
命令与发布资源
Pin 注册了两个 Artisan 命令,并提供错误页与迁移发布标签。
pin:ide-helper
bash
php artisan pin:ide-helper该命令会依次调用:
text
ide-helper:eloquent
ide-helper:generate
ide-helper:meta
ide-helper:models --nowrite --write-mixin适合在开发环境中生成 IDE 提示。需要业务项目安装对应的 ide-helper 命令提供方。
pin:generate:table-schemas
bash
php artisan pin:generate:table-schemas根据数据库结构生成 schema metadata 文件。
参数:
| 参数 | 默认值 | 说明 |
|---|---|---|
--connection | default | 数据库连接名称 |
--force | false | 强制覆盖已存在的 schema 文件 |
示例:
bash
php artisan pin:generate:table-schemas --connection=default --force输出目录:
text
database/schemas/{connection}/生成文件:
| 文件 | 说明 |
|---|---|
__schemas__.php | 所有表结构 metadata 汇总 |
__attributes__.php | 所有表字段 label 汇总 |
{table}.php | 单表 schema,可保留自定义扩展字段 |
发布错误页
bash
php artisan vendor:publish --tag=pin-errors发布路径:
text
resources/views/errors来源:
text
resources/views发布迁移
bash
php artisan vendor:publish --tag=pin-migrations发布路径:
text
database/migrations来源:
text
database/migrations文档站命令
本仓库新增的 VitePress 命令:
bash
pnpm docs:dev
pnpm docs:build
pnpm docs:preview构建输出目录:
text
docs/.vitepress/dist