Laravel Boost 旨在通過(guò)為 AI 提供更完整的上下文與結(jié)構(gòu),來(lái)加速基于 Laravel 的 AI 輔助開(kāi)發(fā)。
從基礎(chǔ)形態(tài)上看,Boost 是一個(gè) MCP 服務(wù)器,內(nèi)置 15+ 個(gè)為 AI 編碼場(chǎng)景而設(shè)計(jì)的專(zhuān)用工具;同時(shí)提供可組合的 AI 指南(guidelines),針對(duì) Laravel 生態(tài)包進(jìn)行定制,使生成代碼保持一致性與框架適配性。
此外,Boost 還內(nèi)置強(qiáng)大的 Documentation API:結(jié)合 MCP 工具與超過(guò) 17,000 條 Laravel 相關(guān)知識(shí)庫(kù),配合基于向量嵌入的語(yǔ)義檢索,返回更精確、具備上下文意識(shí)的結(jié)果。
[!IMPORTANT]
Laravel Boost 目前處于 beta 階段,功能仍在持續(xù)完善與更新。
通過(guò) Composer 安裝(開(kāi)發(fā)依賴(lài)):
composer require laravel/boost --dev
安裝 MCP Server 與編碼指南:
php artisan boost:install
完成安裝后,你可以在 Cursor、Claude Code,或任意你偏好的 AI 編碼代理中開(kāi)始使用。
Name | Notes |
---|---|
Application Info | Read PHP & Laravel versions, database engine, list of ecosystem packages with versions, and Eloquent models |
Browser Logs | Read logs and errors from the browser |
Database Connections | Inspect available database connections, including the default connection |
Database Query | Execute a query against the database |
Database Schema | Read the database schema |
Get Absolute URL | Convert relative path URIs to absolute so agents generate valid URLs |
Get Config | Get a value from the configuration files using "dot" notation |
Last Error | Read the last error from the application's log files |
List Artisan Commands | Inspect the available Artisan commands |
List Available Config Keys | Inspect the available configuration keys |
List Available Env Vars | Inspect the available environment variable keys |
List Routes | Inspect the application's routes |
Read Log Entries | Read the last N log entries |
Report Feedback | Share Boost & Laravel AI feedback with the team, just say "give Boost feedback: x, y, and z" |
Search Docs | Query the Laravel hosted documentation API service to retrieve documentation based on installed packages |
Tinker | Execute arbitrary code within the context of the application |
Laravel Boost 為以下框架與生態(tài)包提供 AI 指南。core
指南為通用建議,適用于該包的所有版本。
Package | Versions Supported |
---|---|
Core & Boost | core |
Laravel Framework | core, 10.x, 11.x, 12.x |
Livewire | core, 2.x, 3.x |
Filament | core, 4.x |
Flux UI | core, free, pro |
Herd | core |
Inertia Laravel | core, 1.x, 2.x |
Inertia React | core, 1.x, 2.x |
Inertia Vue | core, 1.x, 2.x |
Pest | core, 4.x |
PHPUnit | core |
Pint | core |
TailwindCSS | core, 3.x, 4.x |
Livewire Volt | core |
Laravel Folio | core |
Enforce Tests | conditional |
Package | Versions Supported |
---|---|
Laravel Framework | 10.x, 11.x, 12.x |
Filament | 2.x, 3.x, 4.x |
Flux UI | 2.x Free, 2.x Pro |
Inertia | 1.x, 2.x |
Livewire | 1.x, 2.x, 3.x |
Pest | 3.x, 4.x |
Tailwind CSS | 3.x, 4.x |
如果你希望為項(xiàng)目補(bǔ)充自定義的 AI 指南(guidelines),可在應(yīng)用中新增 .ai/guidelines/*
目錄,并放置 .blade.php
文件。執(zhí)行 boost:install
時(shí),這些文件會(huì)與 Boost 自帶的指南一同生效。
在某些情況下,你可能需要在偏好的編輯器中手動(dòng)注冊(cè) Laravel Boost MCP 服務(wù)器。請(qǐng)按以下配置注冊(cè):
命令與參數(shù):
php ./artisan boost:mcp
或以 JSON 方式聲明(示例):
{
"mcpServers": {
"laravel-boost": {
"command": "php",
"args": ["./artisan", "boost:mcp"]
}
}
}