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

Pmu Laravel Package

soyuka/pmu

Monitor PHP-FPM status from Laravel. soyuka/pmu collects and exposes PHP-FPM pool metrics (requests, processes, slowlog-style stats) for easy health checks and observability in apps and dashboards.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Enhanced Sub-Project Support: The new v0.3.0 release introduces plugin support for sub-projects, enabling pmu to manage nested or modular Laravel sub-applications (e.g., app/Modules/, app/Plugins/) within a monorepo. This is a critical fit for Laravel projects using:
    • Modular Laravel architectures (e.g., spatie/laravel-modules, custom plugin systems).
    • Multi-tenant or feature-flagged sub-apps where dependencies must be isolated but centrally managed.
    • Microservices-inspired monorepos where Laravel shares code with APIs, queues, or CLI tools.
  • Composer Plugin Ecosystem Alignment: The feature aligns with Laravel’s plugin architecture (e.g., laravel/valet, spatie/laravel-package-tools), reducing friction for teams already using modular patterns.

Integration Feasibility

  • Sub-Project Isolation: pmu can now scope dependencies and publishing workflows to sub-directories, which is ideal for:
    • Laravel’s app/Providers/ or app/Console/ as sub-projects.
    • Third-party plugin systems (e.g., orchid/software, backpack/crud).
  • Laravel-Specific Workflows:
    • Artisan Command Integration: Sub-project plugins can expose pmu-managed Artisan commands (e.g., php artisan plugin:publish).
    • Service Provider Bootstrapping: Use pmu to load sub-project providers dynamically (e.g., via config/app.php).
  • Composer Script Hooks: Extend composer.json scripts to target sub-projects:
    {
      "scripts": {
        "post-install": "pmu require --sub-project=AdminPanel && pmu publish --sub-project=Auth",
        "post-update": "pmu update --sub-project=Api"
      }
    }
    

Technical Risk

  • Sub-Project Autoloader Conflicts:
    • Risk: Nested PSR-4 autoloading may clash with Laravel’s global autoloader if sub-projects use overlapping namespaces.
    • Mitigation: Use pmu config:autoload to scope sub-project autoload paths or leverage Laravel’s composer.json "extra": "laravel": { "providers": [...] }.
  • Plugin Isolation Gaps:
    • Risk: Laravel’s service container may not fully isolate sub-project bindings (e.g., shared App\ServiceProvider).
    • Mitigation: Use pmu’s --isolate flag for sub-projects and supplement with Laravel’s config/app.php "providers" array.
  • Performance Overhead:
    • Risk: Resolving dependencies for multiple sub-projects may slow composer install.
    • Mitigation: Benchmark with pmu --profile and optimize via composer.json "minimum-stability" or caching layers.

Key Questions

  1. Sub-Project Granularity:
    • How are Laravel’s sub-applications (e.g., app/Admin, app/Api) currently structured? Can they be treated as pmu sub-projects?
    • Will pmu’s sub-project isolation conflict with Laravel’s package discovery (e.g., config/publishes)?
  2. Plugin Ecosystem:
    • Are there existing Laravel plugins (e.g., backpack/crud, orchid/software) that could leverage pmu’s sub-project features?
    • How will pmu handle plugin-specific dependencies (e.g., backpack/crud requiring laravel/framework)?
  3. CI/CD Impact:
    • Will pmu’s sub-project workflows require parallelized CI jobs (e.g., GitHub Actions matrix)?
    • How will pmu interact with Laravel’s mix-manifest.json or Vite if sub-projects include assets?
  4. Rollback Strategy:
    • Can sub-project configurations be reverted to manual composer.json management without breaking Laravel’s autoloader?
    • What’s the fallback if pmu’s sub-project isolation introduces runtime errors (e.g., missing classes)?

Integration Approach

Stack Fit

  • Laravel Modularity Tools:
    • Spatie Laravel Modules: pmu can replace or complement Spatie’s module system for dependency management.
    • Backpack CRUD/Orchid: Sub-project plugins can use pmu to manage their dependencies (e.g., pmu require backpack/crud --sub-project=Admin).
  • Composer Plugin Synergy:
    • Integrate with Laravel’s Composer plugins (e.g., hirak/prestissimo, dealerdirect/phpcodesniffer-composer-installer) via pmu’s --composer-plugin flag.
  • Docker/Dev Containers:
    • Use pmu to pre-configure sub-projects in docker-compose.yml or devcontainer.json:
      services:
        laravel:
          volumes:
            - ./:/workspace
          command: pmu init --sub-project=Api && composer install
      

Migration Path

  1. Phase 1: Sub-Project Discovery

    • Audit Laravel’s modular structure (e.g., app/Admin/, app/Plugins/) and map to pmu sub-projects.
    • Example:
      pmu init --sub-project=Admin --sub-project=Auth
      
    • Validate with pmu list --sub-projects.
  2. Phase 2: Dependency Isolation

    • Migrate sub-project composer.json files to pmu-managed dependencies:
      pmu require backpack/crud --sub-project=Admin
      pmu require spatie/laravel-permission --sub-project=Auth
      
    • Test with composer validate --sub-project=Admin.
  3. Phase 3: Publishing Workflows

    • Replace Laravel’s config/publishes with pmu publish --sub-project=Admin for plugin-specific configs.
    • Example: Publish Admin/config/admin.php to config/admin.php.
  4. Phase 4: Artisan Integration

    • Create custom Artisan commands to bridge pmu and Laravel:
      // app/Console/Commands/PmuPublish.php
      use Soyuka\Pmu\Pmu;
      protected $pmu;
      public function __construct(Pmu $pmu) { $this->pmu = $pmu; }
      public function handle() { $this->pmu->publish(['--sub-project=Api']); }
      
    • Register in app/Console/Kernel.php.
  5. Phase 5: CI/CD Automation

    • Update pipelines to use pmu for sub-project builds:
      # GitHub Actions
      jobs:
        test:
          runs-on: ubuntu-latest
          steps:
            - run: pmu test --sub-project=Admin --sub-project=Auth
      

Compatibility

  • Laravel Plugin Systems:
    • Test with Backpack CRUD, Orchid, and Spatie Modules to ensure pmu’s sub-project isolation doesn’t break plugin-specific logic.
  • Composer Constraints:
    • Ensure pmu’s sub-project dependencies don’t conflict with Laravel’s global composer.json constraints (e.g., ^9.0 vs. ~9.0.0).
  • Autoloader Scoping:
    • Use pmu config:autoload --sub-project=Api to scope autoload paths and avoid conflicts with Laravel’s vendor/autoload.php.

Sequencing

Step Action Tools/Commands Validation
1 Define sub-projects pmu init --sub-project=Admin --sub-project=Auth pmu list --sub-projects
2 Migrate dependencies pmu require package --sub-project=Admin composer validate --sub-project=Admin
3 Test publishing pmu publish --dry-run --sub-project=Auth Verify files in config/
4 Integrate Artisan Create custom commands php artisan pmu:publish --sub-project=Api
5 Update CI/CD Add pmu test --sub-projects to workflows Run in staging
6 Monitor production Log pmu operations Check Laravel logs for errors

Operational Impact

Maintenance

  • Pros:
    • Reduced Duplication: Sub-project dependencies are managed centrally, reducing composer.json sprawl.
    • Isolated Updates: pmu update --sub-project=Admin avoids touching global dependencies.
    • Plugin Lifecycle Management: Easier to enable/disable sub-projects
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.
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
spatie/mailcoach-vapor