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 initializes Boost in your Laravel project, setting up the boost.json config file and default skills.
First Use Case:
php artisan boost:ask "How do I implement a multi-step form with Livewire?"
php artisan boost:ask "Write a Pest test for my User model"
Where to Look First:
php artisan boost:skills to see available AI capabilities (e.g., laravel-best-practices, livewire, pest-testing).boost.json to customize AI models, tokens, or enabled skills.Context-Aware Coding:
boost:ask with file paths or class names for precise context:
php artisan boost:ask "Refactor this controller" --file=app/Http/Controllers/UserController.php
Skill-Based Workflows:
php artisan boost:skills --enable=livewire,laravel-best-practices
pest-testing skill to generate tests:
php artisan boost:ask "Create a feature test for the auth flow"
laravel-best-practices to audit code:
php artisan boost:ask "Review this code for Laravel best practices" --file=app/Services/InvoiceService.php
Integration with IDEs:
// boost.json
{
"agents": {
"kiro": {
"enabled": true
}
}
}
Project-Specific Guidelines:
resources/boost/skills/:
# SKILL: custom-guideline.md
---
title: "Project-Specific Rules"
---
Always use `Str::of()->title()` for formatting.
Testing Workflow:
php artisan boost:ask "Write and run a test for the UserController store method"
--enforce-tests in boost.json to require test generation for new features.CI/CD Pipelines:
boost:update to sync skills before deployments:
php artisan boost:update --discover
Monorepos:
mcp_config_path in boost.json:
{
"mcp_config_path": "path/to/monorepo/boost.json"
}
Cloud Integration:
php artisan boost:install --cloud
deployment guidelines).Custom Agents:
// boost.json
{
"agents": {
"claude": {
"enabled": true,
"model": "claude-3-opus",
"cwd": "./"
}
}
}
Token Limits:
--file or --class flags to narrow scope:
php artisan boost:ask "Optimize this" --class=App\Models\User
Skill Conflicts:
livewire + blade) may generate conflicting advice.php artisan boost:skills --disable=blade
Caching Quirks:
php artisan boost:clear
cache_prefix in boost.json for Laravel 13+:
{
"cache": {
"prefix": "boost_"
}
}
Model Version Mismatches:
vapor:deploy in Laravel 10).php artisan boost:ask "Show me Laravel 11 migration syntax"
Livewire-Specific Gotchas:
SKILL.blade.php in resources/boost/skills/livewire/ or use:
php artisan boost:skills --enable=livewire-v4
Verbose Output:
php artisan boost:ask "Debug this" --verbose
storage/logs/boost.log.Skill Validation:
php artisan boost:validate-skill resources/boost/skills/custom-guideline.md
Network Issues:
Http::pool errors when downloading remote skills.boost.json:
{
"http": {
"proxy": "http://your-proxy:port"
}
}
PHP Path Conflicts:
php_executable in boost.json:
{
"tools": {
"php_executable": "/path/to/your/php"
}
}
Custom Skills:
resources/boost/skills/ with frontmatter:
# SKILL: custom-skill.md
---
title: "Custom Skill"
description: "Describe your skill's purpose."
---
# Your guidelines here.
boost:update.Agent Hooks:
app/Providers/BoostServiceProvider.php:
use Laravel\Boost\Events\AgentInitializing;
public function boot()
{
event(new AgentInitializing(function ($agent) {
$agent->extend('custom', function () {
return new CustomAgent();
});
}));
}
Pre/Post-Processing:
// app/Providers/BoostServiceProvider.php
public function boot()
{
Boost::macro('renderSkill', function ($skill) {
return str_replace('{{placeholder}}', 'custom-value', $skill);
});
}
Testing Boost:
use Laravel\Boost\Facades\Boost;
Boost::shouldReceive('askAI')->andReturn('Mocked response');
How can I help you explore Laravel packages today?