Installation
composer require sandermuller/package-boost-php
Requires sandermuller/boost-core (install via composer require sandermuller/boost-core).
First Use Case
Add the Boostable trait to your package’s main class (e.g., src/YourPackage.php):
use Sandermuller\Boost\Boostable;
class YourPackage
{
use Boostable;
}
Trigger Boost
Call boost() in your package’s initialization logic (e.g., service provider):
public function boot()
{
$this->boost();
}
Verify
Check logs (storage/logs/laravel.log) for AI-generated optimizations or run:
php artisan boost:check
Automated Optimization
composer.json scripts:
"scripts": {
"post-autoload-dump": "boost:check"
}
php artisan boost:run to analyze and apply changes.Laravel-Specific Integration
boost() in boot() methods to auto-optimize dependencies.BoostCommand for custom rules:
use Sandermuller\Boost\Commands\BoostCommand;
class CustomBoostCommand extends BoostCommand
{
protected $rules = [
'laravel' => [
'use Illuminate\Support\Facades\Route;',
'optimize' => 'route caching',
],
];
}
Dependency Injection
BoostServiceProvider in config/app.php:
'providers' => [
Sandermuller\Boost\BoostServiceProvider::class,
],
Configuration
php artisan vendor:publish --provider="Sandermuller\Boost\BoostServiceProvider"
config/boost.php for AI model endpoints, rate limits, or excluded files.boost.php:
'optimizations' => [
'routes' => true,
],
AppServiceProvider:
public function boot()
{
\Sandermuller\Boost\Eloquent::boost();
}
$this->boost()->optimizeQueuePayloads();
AI Model Dependencies
BOOST_OFFLINE=true in .env for cached-only mode.Over-Optimization
--dry-run flag:
php artisan boost:run --dry-run
File Exclusions
vendor/, node_modules/, and test files in boost.php:
'excludes' => [
'tests/*',
'vendor/*',
],
PHP Version Mismatch
Class 'Stringable' not found → Upgrade PHP or add:
'php_version' => '8.1',
storage/logs/boost.log for AI responses and applied changes.php artisan boost:run -v
php artisan cache:clear
php artisan boost:clear-cache
Custom Rules
Override Boostable::getRules() to add package-specific optimizations:
protected function getRules(): array
{
return array_merge(parent::getRules(), [
'laravel' => [
'use Illuminate\Pagination\LengthAwarePaginator;',
'optimize' => 'paginator chunking',
],
]);
}
Event Listeners
Listen for boost.applied events to log or trigger side effects:
event(new BoostApplied($optimizations));
Testing Mock AI responses in tests:
$this->mockBoostResponse([
'optimizations' => ['use Illuminate\Support\Collection;'],
]);
How can I help you explore Laravel packages today?