sandermuller/package-boost-laravel
Installation
composer require sandermuller/package-boost-laravel
Add to composer.json under extra:
"boost": {
"emitters": [
"sandermuller/package-boost-laravel"
]
}
First Use Case
Run the boost:sync Artisan command to generate a .mcp.json manifest:
php artisan boost:sync
This auto-detects Laravel-specific metadata (e.g., service providers, routes, migrations) and merges it with PHP package metadata.
php artisan boost:sync (core command).mcp.json (generated in project root)illuminate/* only in require-dev for testingDevelopment Loop
boost:sync after adding new Laravel features (e.g., commands, events)..mcp.json with php artisan boost:validate.CI/CD Hooks
# Example GitHub Actions step
- name: Sync Boost Manifest
run: php artisan boost:sync
Commit .mcp.json to version control for reproducibility.
Dynamic Metadata
No longer requires a config file. Use the boost:sync command directly or extend via the Boost PHP API.
Service Provider Detection
Automatically scans config/app.php for providers and includes their classes in the manifest.
Route Grouping
Groups routes by middleware (e.g., auth:api, web) in the emitted manifest.
Event/Listener Mapping
Detects listen entries in EventServiceProvider and includes them under events in .mcp.json.
Migration Tracking
Lists migrations in the database/migrations directory under migrations in the manifest.
Custom Metadata Extend the manifest via a service provider or directly in your code:
use Sandermuller\PackageBoost\Boost;
Boost::extend(function ($manifest) {
$manifest['custom'] = [
'docs_url' => 'https://example.com/docs',
];
});
Manifest Filters
Use the Boost::filter() method to modify the manifest before emission:
Boost::filter(function ($manifest) {
unset($manifest['ignored_key']);
});
Manifest Overwrites
Running boost:sync clobbers .mcp.json. Use --dry-run to preview changes:
php artisan boost:sync --dry-run
No Longer Requires Service Provider
The PackageBoostLaravelServiceProvider and related config are removed. Ensure no legacy code references them.
Laravel Dependency Changes
illuminate/* packages are now require-dev only. No runtime dependency on Laravel is enforced.
Validate Manifest
php artisan boost:validate
Fails if the manifest is malformed or missing required Laravel fields.
Log Output Enable verbose mode for detailed scanning:
php artisan boost:sync --verbose
Schema Mismatches
If .mcp.json fails validation, compare against the MCP Schema and update your code.
Laravel-Specific Fields Leverage these in your manifest:
providers: Array of service provider classes.routes: Grouped by middleware (e.g., {'auth': ['/admin/*']}).migrations: List of migration paths.commands: Artisan command classes.Dynamic Versioning
Use Laravel’s VERSION constant in your manifest:
'version' => env('APP_VERSION', require __DIR__.'/../version.php'),
Testing Mock the manifest in tests:
$manifest = Boost::getManifest();
$this->assertArrayHasKey('providers', $manifest);
Performance Cache the manifest in production by setting:
'cache_manifest' => env('BOOST_CACHE', true),
in your .boost.json config (if used).
No Laravel Runtime Dependency
Since illuminate/* is now require-dev, this package can be used in any PHP environment without forcing a Laravel dependency.
How can I help you explore Laravel packages today?