Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Package Boost Php Laravel Package

sandermuller/package-boost-php

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation

    composer require sandermuller/package-boost-php
    

    Requires sandermuller/boost-core (install via composer require sandermuller/boost-core).

  2. 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;
    }
    
  3. Trigger Boost Call boost() in your package’s initialization logic (e.g., service provider):

    public function boot()
    {
        $this->boost();
    }
    
  4. Verify Check logs (storage/logs/laravel.log) for AI-generated optimizations or run:

    php artisan boost:check
    

Implementation Patterns

Core Workflows

  1. Automated Optimization

    • Pre-commit Hook: Integrate with composer.json scripts:
      "scripts": {
          "post-autoload-dump": "boost:check"
      }
      
    • Manual Trigger: Run php artisan boost:run to analyze and apply changes.
  2. Laravel-Specific Integration

    • Service Providers: Use boost() in boot() methods to auto-optimize dependencies.
    • Commands: Extend BoostCommand for custom rules:
      use Sandermuller\Boost\Commands\BoostCommand;
      
      class CustomBoostCommand extends BoostCommand
      {
          protected $rules = [
              'laravel' => [
                  'use Illuminate\Support\Facades\Route;',
                  'optimize' => 'route caching',
              ],
          ];
      }
      
  3. Dependency Injection

    • Register the BoostServiceProvider in config/app.php:
      'providers' => [
          Sandermuller\Boost\BoostServiceProvider::class,
      ],
      
  4. Configuration

    • Publish config with:
      php artisan vendor:publish --provider="Sandermuller\Boost\BoostServiceProvider"
      
    • Customize config/boost.php for AI model endpoints, rate limits, or excluded files.

Laravel-Specific Tips

  • Route Optimization: Enable route caching in boost.php:
    'optimizations' => [
        'routes' => true,
    ],
    
  • Eloquent Boost: Add to AppServiceProvider:
    public function boot()
    {
        \Sandermuller\Boost\Eloquent::boost();
    }
    
  • Queue Jobs: Auto-optimize job payloads:
    $this->boost()->optimizeQueuePayloads();
    

Gotchas and Tips

Pitfalls

  1. AI Model Dependencies

    • Requires internet access for first run (caches responses locally afterward).
    • Fix: Set BOOST_OFFLINE=true in .env for cached-only mode.
  2. Over-Optimization

    • AI may suggest aggressive changes (e.g., removing error handling).
    • Mitigation: Use --dry-run flag:
      php artisan boost:run --dry-run
      
  3. File Exclusions

    • Ignore vendor/, node_modules/, and test files in boost.php:
      'excludes' => [
          'tests/*',
          'vendor/*',
      ],
      
  4. PHP Version Mismatch

    • Package supports PHP 8.1+. Error: Class 'Stringable' not found → Upgrade PHP or add:
      'php_version' => '8.1',
      

Debugging

  • Logs: Check storage/logs/boost.log for AI responses and applied changes.
  • Verbose Mode:
    php artisan boost:run -v
    
  • Reset Cache: Clear Boost cache if stuck:
    php artisan cache:clear
    php artisan boost:clear-cache
    

Extension Points

  1. 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',
            ],
        ]);
    }
    
  2. Event Listeners Listen for boost.applied events to log or trigger side effects:

    event(new BoostApplied($optimizations));
    
  3. Testing Mock AI responses in tests:

    $this->mockBoostResponse([
        'optimizations' => ['use Illuminate\Support\Collection;'],
    ]);
    
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
calmfox/watch-sylius
damienfern/grpc-symfony-bundle
atoolo/index-bundle
atoolo/genai-bundle
coprotoai/laravel-ticket
davidjln/llm-carbon-bundle
cryonighter/valid-request-bundle
coolms/taxonomy-bundle
coolms/field-bundle
articulate-orm/symfony
aaix/laravel-tall-architect
ephoto/akeneo-connector
emmanuelballery/eb-plantumlbundle
emielburgman/symfony-visitor-beacon
emielburgman/symfony-visit-storage
emielburgman/symfony-security-headers
emielburgman/symfony-log-viewer
emarref/xdebug-bundle
emarref/pubnub-bundle
elriseio/finance-money-bundle