Laravel AI 辅助开发包 Laravel Boost 已发布

Laravel AI

简介

Laravel Boost 旨在通过为 AI 提供更完整的上下文与结构,来加速基于 Laravel 的 AI 辅助开发。

从基础形态上看,Boost 是一个 MCP 服务器,内置 15+ 个为 AI 编码场景而设计的专用工具;同时提供可组合的 AI 指南(guidelines),针对 Laravel 生态包进行定制,使生成代码保持一致性与框架适配性。

此外,Boost 还内置强大的 Documentation API:结合 MCP 工具与超过 17,000 条 Laravel 相关知识库,配合基于向量嵌入的语义检索,返回更精确、具备上下文意识的结果。

IMPORTANT

Laravel Boost 目前处于 beta 阶段,功能仍在持续完善与更新。

安装

通过 Composer 安装(开发依赖):

bash
composer require laravel/boost --dev

安装 MCP Server 与编码指南:

bash
php artisan boost:install

完成安装后,你可以在 Cursor、Claude Code,或任意你偏好的 AI 编码代理中开始使用。

可用 MCP 工具

NameNotes
Application InfoRead PHP & Laravel versions, database engine, list of ecosystem packages with versions, and Eloquent models
Browser LogsRead logs and errors from the browser
Database ConnectionsInspect available database connections, including the default connection
Database QueryExecute a query against the database
Database SchemaRead the database schema
Get Absolute URLConvert relative path URIs to absolute so agents generate valid URLs
Get ConfigGet a value from the configuration files using "dot" notation
Last ErrorRead the last error from the application's log files
List Artisan CommandsInspect the available Artisan commands
List Available Config KeysInspect the available configuration keys
List Available Env VarsInspect the available environment variable keys
List RoutesInspect the application's routes
Read Log EntriesRead the last N log entries
Report FeedbackShare Boost & Laravel AI feedback with the team, just say "give Boost feedback: x, y, and z"
Search DocsQuery the Laravel hosted documentation API service to retrieve documentation based on installed packages
TinkerExecute arbitrary code within the context of the application

可用 AI 指南(Guidelines)

Laravel Boost 为以下框架与生态包提供 AI 指南。core 指南为通用建议,适用于该包的所有版本。

PackageVersions Supported
Core & Boostcore
Laravel Frameworkcore, 10.x, 11.x, 12.x
Livewirecore, 2.x, 3.x
Filamentcore, 4.x
Flux UIcore, free, pro
Herdcore
Inertia Laravelcore, 1.x, 2.x
Inertia Reactcore, 1.x, 2.x
Inertia Vuecore, 1.x, 2.x
Pestcore, 4.x
PHPUnitcore
Pintcore
TailwindCSScore, 3.x, 4.x
Livewire Voltcore
Laravel Foliocore
Enforce Testsconditional

可用文档(Documentation)

PackageVersions Supported
Laravel Framework10.x, 11.x, 12.x
Filament2.x, 3.x, 4.x
Flux UI2.x Free, 2.x Pro
Inertia1.x, 2.x
Livewire1.x, 2.x, 3.x
Pest3.x, 4.x
Tailwind CSS3.x, 4.x

添加自定义 AI 指南

如果你希望为项目补充自定义的 AI 指南(guidelines),可在应用中新增 .ai/guidelines/* 目录,并放置 .blade.php 文件。执行 boost:install 时,这些文件会与 Boost 自带的指南一同生效。

手动注册 Boost MCP 服务器

在某些情况下,你可能需要在偏好的编辑器中手动注册 Laravel Boost MCP 服务器。请按以下配置注册:

命令与参数:

bash
php ./artisan boost:mcp

或以 JSON 方式声明(示例):

json
{
  "mcpServers": {
    "laravel-boost": {
      "command": "php",
      "args": ["./artisan", "boost:mcp"]
    }
  }
}

视频介绍

Laravel AI 视频介绍

JaguarJack
后端开发工程师,前端入门选手,略知相关服务器知识,偏爱❤️ Laravel & Vue
本作品采用《CC 协议》,转载必须注明作者和本文链接