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 Laravel Laravel Package

sandermuller/package-boost-laravel

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation

    composer require sandermuller/package-boost-laravel
    

    Add to composer.json under extra:

    "boost": {
        "emitters": [
            "sandermuller/package-boost-laravel"
        ]
    }
    
  2. 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.


Where to Look First

  • Artisan Commands: php artisan boost:sync (core command)
  • Manifest: .mcp.json (generated in project root)
  • Documentation: PUBLIC_API.md (locked API surface)
  • Testbench: Uses illuminate/* only in require-dev for testing

Implementation Patterns

Workflow Integration

  1. Development Loop

    • Run boost:sync after adding new Laravel features (e.g., commands, events).
    • Validate .mcp.json with php artisan boost:validate.
  2. CI/CD Hooks

    # Example GitHub Actions step
    - name: Sync Boost Manifest
      run: php artisan boost:sync
    

    Commit .mcp.json to version control for reproducibility.

  3. Dynamic Metadata No longer requires a config file. Use the boost:sync command directly or extend via the Boost PHP API.


Common Patterns

  • 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.


Extension Points

  1. 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',
        ];
    });
    
  2. Manifest Filters Use the Boost::filter() method to modify the manifest before emission:

    Boost::filter(function ($manifest) {
        unset($manifest['ignored_key']);
    });
    

Gotchas and Tips

Pitfalls

  1. Manifest Overwrites Running boost:sync clobbers .mcp.json. Use --dry-run to preview changes:

    php artisan boost:sync --dry-run
    
  2. No Longer Requires Service Provider The PackageBoostLaravelServiceProvider and related config are removed. Ensure no legacy code references them.

  3. Laravel Dependency Changes illuminate/* packages are now require-dev only. No runtime dependency on Laravel is enforced.


Debugging

  1. Validate Manifest

    php artisan boost:validate
    

    Fails if the manifest is malformed or missing required Laravel fields.

  2. Log Output Enable verbose mode for detailed scanning:

    php artisan boost:sync --verbose
    
  3. Schema Mismatches If .mcp.json fails validation, compare against the MCP Schema and update your code.


Tips

  1. 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.
  2. Dynamic Versioning Use Laravel’s VERSION constant in your manifest:

    'version' => env('APP_VERSION', require __DIR__.'/../version.php'),
    
  3. Testing Mock the manifest in tests:

    $manifest = Boost::getManifest();
    $this->assertArrayHasKey('providers', $manifest);
    
  4. Performance Cache the manifest in production by setting:

    'cache_manifest' => env('BOOST_CACHE', true),
    

    in your .boost.json config (if used).

  5. No Laravel Runtime Dependency Since illuminate/* is now require-dev, this package can be used in any PHP environment without forcing a Laravel dependency.

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.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky