laravel/boost
Laravel Boost accelerates AI-assisted Laravel development by supplying the context, conventions, and structure AI needs to generate high-quality, framework-specific code and suggestions, helping teams build faster while staying aligned with Laravel best practices.
Installation:
composer require laravel/boost
php artisan boost:install
This installs the MCP server and configures Laravel-specific AI context.
First Use Case: Open your IDE (VSCode, PHPStorm, or Zed) and start typing Laravel code. Boost automatically injects relevant context (routes, models, config) into your AI agent's prompts.
Key Files to Review:
config/boost.php (core configuration).boost/skills/ (custom skill definitions)app/Providers/BoostServiceProvider.php (service binding)Edit config/boost.php to:
google/antigravity, openai/chatgpt)enforce_tests (default: true)mcp_config_path for monoreposphp artisan boost:skills
Lists available skills (e.g., laravel, livewire, pest) to enable/disable.
Context-Aware Coding:
php artisan make:model User), then ask Boost to generate migrations, factories, or seeders./route in your IDE, and Boost suggests relevant route logic.@component or @slot and let Boost auto-complete the component structure.Skill-Based Workflows:
php artisan boost:skill enable livewire
php artisan boost:skill enable pest
wire:model).tests/ conventions.IDE-Specific Patterns:
boost:context command in the command palette to refresh context.boost tool in your editor’s AI integration settings.Testing Integration:
php artisan boost:test "generate feature test for UserController@store"
Generates a Pest test file with assertions for your controller method.
Custom Skills:
Create a skill in .boost/skills/custom/your-skill.php:
return [
'name' => 'Custom Skill',
'description' => 'Handles XYZ logic',
'rules' => [
'use Custom\Namespace;',
'extend BaseClass { ... }',
],
];
Register it via:
php artisan boost:skill register custom/your-skill
Agent-Specific Prompts:
Override agent prompts in config/boost.php:
'agents' => [
'google/antigravity' => [
'prompt_template' => '@include("boost::prompts.antigravity")',
],
],
Monorepo Support:
Set mcp_config_path in config/boost.php to point to your monorepo’s root MCP config:
'mcp_config_path' => base_path('../mcp.config.json'),
CI/CD Integration:
Use boost:validate in your pipeline to enforce guidelines:
php artisan boost:validate --fix
Agent Detection Issues:
config/boost.php:
'agent' => 'zed', // or 'vscode', 'phpstorm', 'cli'
zed or zeditor (see PR #846).Skill Conflicts:
laravel and livewire).boost:skill disable to temporarily disable conflicting skills or adjust rule precedence in .boost/skills/.Context Refresh Delays:
php artisan boost:context
post-update-cmd hook in composer.json:
"scripts": {
"post-update-cmd": "php artisan boost:context"
}
MCP Configuration Quirks:
.boost/mcp.config.json.php artisan boost:config:generate
mcp_config_path to the root config file (see PR #729).Test Enforcement:
enforce_tests blocks code generation.php artisan boost:config:set enforce_tests=false
--no-tests flag:
php artisan boost:generate --no-tests
Log Level:
Enable debug logs in config/boost.php:
'logging' => [
'level' => 'debug',
],
Check logs at storage/logs/boost.log.
Skill Validation: Validate a skill’s syntax:
php artisan boost:skill:validate livewire
Agent Communication: Test agent connectivity:
php artisan boost:agent:test
Context Inspection: Dump the current context:
php artisan boost:context:dump
Custom Prompt Templates:
Override templates in resources/views/boost/prompts/. Example:
@extends('boost::prompts.base')
@section('context')
{{ $context->models->take(5) }}
{{ $context->routes->take(3) }}
@endsection
Event Listeners:
Listen for Boost events in EventServiceProvider:
protected $listen = [
\Laravel\Boost\Events\GuidelinesGenerated::class => [
\App\Listeners\LogGuidelines::class,
],
];
MCP Tool Extensions: Add custom MCP tools by publishing the config:
php artisan vendor:publish --tag="boost-config"
Then extend config/boost.php:
'tools' => [
'custom' => [
'description' => 'Runs custom logic',
'command' => 'php artisan custom:logic',
],
],
Livewire Integration:
For Livewire v4+ compatibility, ensure your SKILL.blade.php uses:
'livewire' => [
'paths' => [
app_path('Http/Livewire'),
resource_path('js/Components'),
],
],
(See PR #736.)
Skill Chaining: Combine skills for complex workflows:
php artisan boost:skill enable livewire,pest,style
Agent-Specific Shortcuts:
!!boost in Zed to trigger Boost.php artisan make:model User | php artisan boost:generate
Performance: Exclude large files from context:
'context' => [
'exclude' => [
'storage/*',
'node_modules/*',
],
],
Upgrade Notes:
Security:
exclude in config/boost.php.boost:validate in pre-commit hooks to catch guideline violations early.How can I help you explore Laravel packages today?