laravel/boost
Laravel Boost speeds up AI-assisted Laravel development by supplying the context and structure AI needs to generate accurate, framework-specific code. It helps produce higher-quality suggestions, scaffolding, and solutions tailored to your application.
Installation:
composer require laravel/boost
Run the publisher to publish the config file:
php artisan vendor:publish --provider="Laravel\Boost\BoostServiceProvider"
Configure AI Provider:
Edit config/boost.php to set your preferred AI provider (e.g., OpenAI, Anthropic, or local tools like codex or mcp).
First Use Case: Trigger Boost via Artisan:
php artisan boost:assist
Or use the Tinker-like interface:
php artisan boost:tinker
boost:assist: Invokes AI assistance for the current context (e.g., file, class, or command).boost:tinker: Interactive shell for querying AI about your project.boost:update: Updates installed skills (custom rules/guidelines).Context-Aware Assistance:
boost:assist in your IDE terminal while focused on a file/class:
php artisan boost:assist --file=app/Http/Controllers/UserController.php
php artisan boost:assist --class=App\Models\User
Skill-Based Guidance:
livewire, pest, migrations) or add custom ones:
php artisan boost:add-skill gitlab.com/your-skill-repo
php artisan boost:assist --skill=livewire --prompt="Create a CRUD component for posts."
Interactive Debugging:
boost:tinker to ask AI about your project’s structure, logs, or edge cases:
php artisan boost:tinker
> Explain why this query is slow: SELECT * FROM users WHERE created_at > NOW() - INTERVAL '1 day';
Testing Assistance:
php artisan boost:assist --file=tests/Feature/UserTest.php --prompt="Add a test for failed login."
Monorepo Support:
mcp_config_path in boost.php for multi-package projects:
'mcp_config_path' => base_path('mcp.config.json'),
boost:assist to a keyboard shortcut in your IDE (e.g., VSCode tasks or PHPStorm run configurations).php artisan boost:assist --file=app/Http/Controllers/$(git diff --name-only --diff-filter=ACM | head -1)
- name: Generate test cases
run: php artisan boost:assist --prompt="Write tests for the new auth logic." --output=tests/Feature/AuthTest.php
Skill Discovery Issues:
boost.json is in your project root and symlinks are resolved (use --discover flag):
php artisan boost:update --discover
mcp_config_path points to the correct config file.AI Provider Quirks:
codex or mcp, ensure the CLI tools are installed and in PATH.--file or --class flags instead.Configuration Conflicts:
app_path()) in boost.php if your project uses non-standard locations:
'app_path' => base_path('custom_app_dir'),
Skill Template Errors:
php artisan boost:add-skill --dry-run
boost.php:
'debug' => env('BOOST_DEBUG', false),
storage/logs/boost.log for tool execution errors.php artisan boost:skill-test gitlab.com/laravel/boost:livewire
Custom Skills:
skill.json manifest and SKILL.blade.php template./skills/my-skill/
├── skill.json # Metadata (name, description, rules)
└── SKILL.blade.php # Blade template for AI prompts
Hooks:
Boost.Skill.Discovered):
use Laravel\Boost\Events\SkillDiscovered;
SkillDiscovered::listen(function (SkillDiscovered $event) {
// Log or modify discovered skills
});
Tool Integration:
config/boost.php under tools:
'tools' => [
'custom' => [
'class' => \App\Boost\CustomTool::class,
'description' => 'Runs custom logic for my app.',
],
],
--concise flag to reduce AI response length:
php artisan boost:assist --concise
'cache_skills' => false,
'parallel_tools' => false,
How can I help you explore Laravel packages today?