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

Cli Laravel Package

app-dev-panel/cli

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation

    composer require app-dev-panel/cli --dev
    

    Add to composer.json under "require-dev" to ensure it’s only installed in local/dev environments.

  2. Publish Config (Optional)

    php artisan vendor:publish --provider="AppDevPanel\Cli\CliServiceProvider" --tag="config"
    

    Check config/app-dev-panel.php for default settings (e.g., debug server port, HTTP server routes).

  3. First Use Case: Debug Server Launch the debug server with:

    php artisan dev-panel:debug
    

    Access at http://localhost:8080 (or configured port). Useful for inspecting routes, middleware, and service containers in real-time.


Implementation Patterns

Workflows

  1. Debugging Routes/Middleware

    • Run php artisan dev-panel:debug and navigate to the "Routes" tab to visualize route registration, middleware stacks, and bindings.
    • Use the "Middleware" tab to inspect middleware execution order and payloads.
  2. Data Queries

    • Execute raw SQL or Eloquent queries via the "Query" tab:
      php artisan dev-panel:query "select * from users where id = 1"
      
    • Supports parameter binding and result formatting (JSON/CSV).
  3. Standalone HTTP Server

    • Spin up a read-only server for testing API endpoints:
      php artisan dev-panel:server --port=8000
      
    • Configure allowed routes in config/app-dev-panel.php under http_server.routes.
  4. Integration with Laravel Events

    • Listen for AppDevPanel\Cli\Events\DebugServerStarted to hook into debug server lifecycle:
      use AppDevPanel\Cli\Events\DebugServerStarted;
      
      Event::listen(DebugServerStarted::class, function () {
          // Custom logic (e.g., log server startup)
      });
      

Tips for Daily Use

  • Alias Commands: Add to ~/.bashrc or ~/.zshrc for convenience:
    alias devdebug="php artisan dev-panel:debug"
    alias devquery="php artisan dev-panel:query"
    
  • Environment-Specific: Use in .env:
    APP_DEV_PANEL_ENABLED=true
    
    Disable in production via config/app.php:
    'dev_panel' => env('APP_DEV_PANEL_ENABLED', false),
    

Gotchas and Tips

Pitfalls

  1. Port Conflicts

    • Default ports (8080 for debug, 8000 for HTTP server) may clash. Override via CLI:
      php artisan dev-panel:debug --port=9090
      
    • Check for existing processes with lsof -i :8080.
  2. Eloquent Model Introspection

    • The "Models" tab may not reflect real-time changes if the debug server caches metadata. Restart the server after schema/migrations:
      php artisan dev-panel:debug --clear-cache
      
  3. HTTP Server Security

    • The standalone server is read-only but binds to 0.0.0.0 by default. Restrict to 127.0.0.1 in config:
      'http_server' => [
          'host' => '127.0.0.1',
      ],
      
  4. Query Performance

    • Complex queries (e.g., joins with select *) may time out. Limit results:
      php artisan dev-panel:query "select id, name from users limit 100"
      

Debugging

  • Logs: Enable verbose output for commands:

    php artisan dev-panel:debug -v
    

    Check storage/logs/laravel.log for errors.

  • Configuration Overrides: Use environment variables to tweak settings:

    APP_DEV_PANEL_DEBUG_PORT=8081
    APP_DEV_PANEL_QUERY_TIMEOUT=30
    

Extension Points

  1. Custom Tabs Extend the debug server by creating a service provider:

    use AppDevPanel\Cli\Facades\DebugPanel;
    
    DebugPanel::addTab('my-tab', function () {
        return view('vendor.app-dev-panel.tabs.my-tab');
    });
    
  2. Query Macros Add reusable query shortcuts in a service provider:

    use AppDevPanel\Cli\Facades\QueryPanel;
    
    QueryPanel::macro('user-count', function () {
        return QueryPanel::run("select count(*) as total from users");
    });
    

    Use via CLI:

    php artisan dev-panel:query "user-count"
    
  3. Middleware Inspection Override the middleware inspector to add custom data:

    use AppDevPanel\Cli\Events\MiddlewareInspected;
    
    Event::listen(MiddlewareInspected::class, function ($payload) {
        $payload->addData('custom_key', 'custom_value');
    });
    
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