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

Phanybar Laravel Package

2bj/phanybar

Control AnyBar from PHP or the command line. Send color/status updates to a running AnyBar instance, optionally targeting a custom UDP port. Includes a simple CLI (phanybar green) and a small library API (send('green', 1738)).

View on GitHub
Deep Wiki
Context7

Getting Started

  1. Ensure AnyBar is installed and running — Phanybar is just a client, not the actual status indicator. Download and launch AnyBar (macOS only). Verify it's listening (default port 1738).
  2. Install Phanybar via Composer:
    composer require 2bj/phanybar
    
  3. First use case — Trigger a status change in response to a task:
    require 'vendor/autoload.php';
    use Bakyt\Console\Phanybar;
    
    $phanybar = new Phanybar();
    $phanybar->send('green'); // Turn AnyBar green (e.g., build passed)
    
    Ideal for CI/CD feedback: turn green on success, red on failure.

Implementation Patterns

  • CLI integration: Wrap Phanybar in artisan commands or shell scripts for visual project status:
    # In a deployment script
    php artisan deploy && phanybar green || phanybar red
    
  • Background job feedback: In Laravel, send status updates from queue workers:
    // In a job's `handle()`
    $phanybar = new Phanybar();
    $phanybar->send('blue'); // 'processing'
    
  • Test suite integration: Color-code test runs:
    // PHPUnit bootstrap file
    (new Phanybar)->send($result->failures() > 0 ? 'red' : 'green');
    
  • Configurable port: Use explicit port in multi-dev environments:
    $phanybar->send('yellow', 1739); // Avoid conflicts if running multiple AnyBar instances
    

Gotchas and Tips

  • ⚠️ No native Laravel service provider — This is a standalone class (not Laravel-aware). Manually instantiate or bind in a service provider.
  • Port mismatch pitfalls: AnyBar defaults to 1738; if running multiple instances (e.g., AnyBar -p 1739), you must specify the port in send().
  • macOS-only restriction: AnyBar is macOS-only. Phanybar won’t help in Linux/Windows CI unless using WSL/macOS runners.
  • No async guarantee: send() is blocking UDP. For high-frequency updates, batch calls or debounce with a queue.
  • Mature but frozen: Last release in 2015 — verify compatibility with PHP 8+ (tested up to 5.6 in source). If breaking, extend:
    class ModernPhanybar extends Phanybar {
        public function send(string $color, int $port = 1738): void {
            $socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
            socket_sendto($socket, $color, strlen($color), 0, '127.0.0.1', $port);
            socket_close($socket);
        }
    }
    
  • Debug tip: Use netcat to verify messages reach AnyBar:
    echo "red" | nc -u -w0 127.0.0.1 1738
    
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4