Skip to content

命令与发布资源

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 文件。

参数:

参数默认值说明
--connectiondefault数据库连接名称
--forcefalse强制覆盖已存在的 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