softpyramid/forge-status 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

softpyramid/forge-status

Composer 安装命令:

composer require softpyramid/forge-status

包简介

Real-time Laravel Forge deployment status indicator via webhooks

README 文档

README

Latest Version on Packagist Total Downloads Laravel Version PHP Version

Real-time deployment status indicator for Laravel Forge using webhooks. Get instant visual feedback when your deployments start, succeed, or fail.

Features

  • 🚀 Real-time Updates - Simple polling-based live deployment status
  • 🎯 No Database Required - Uses cache only for current status
  • 🔗 Webhook-driven - Receives deployment events from Laravel Forge
  • 🎨 Auto-injection - Automatically appears in your Laravel layouts
  • ⚙️ Configurable - Customizable polling interval and authentication
  • 🖥️ Full-Screen Overlay - Prominent modal-style deployment notifications
  • 🎭 Modern UI - Beautiful Tailwind CSS styling
  • 📱 Responsive - Works on all device sizes
  • 🔧 Zero Dependencies - No broadcasting or WebSocket setup required

Requirements

  • PHP 8.2 or higher
  • Laravel 10, 11, or 12
  • No additional dependencies required!

Installation

composer require softpyramid/forge-status

The package will automatically register its routes and service provider. No manual configuration needed!

Configuration

1. Publish config (optional):

php artisan vendor:publish --tag=forge-status-config

2. Add to .env (optional):

FORGE_WEBHOOK_TOKEN=your-secret-token
FORGE_POLL_INTERVAL=5
FORGE_AUTH_ONLY=true

3. Register Webhook in Laravel Forge

In your Forge site settings:

  1. Go to "Webhooks"
  2. Add new webhook URL: https://yourdomain.com/forge-webhook
  3. Optionally add token parameter: https://yourdomain.com/forge-webhook?token=your-secret-token

Usage

Auto-inject into layouts

Add the component to your layout file (e.g., resources/views/layouts/app.blade.php):

<body>
    <!-- Your content -->
    
    <x-forge-deployment-indicator />
</body>

That's it! The indicator will automatically appear when deployments start and update in real-time.

How It Works

  1. Forge sends webhook POST request when deployment starts/finishes
  2. Package receives webhook and stores status in cache
  3. Frontend polls the status endpoint every few seconds
  4. Indicator updates automatically when status changes
  5. No database storage - uses cache for current status only
  6. Simple and reliable - no WebSocket complexity

Laravel Version Compatibility

Laravel Version Package Version PHP Version
Laravel 12.x ^1.0 ^8.2
Laravel 11.x ^1.0 ^8.2
Laravel 10.x ^1.0 ^8.1

Testing

# Run tests
composer test

# Run tests with coverage
composer test-coverage

Testing

Test the package functionality

# Test with success status (default)
php artisan forge-status:test

# Test with different statuses
php artisan forge-status:test --status=deploying
php artisan forge-status:test --status=success
php artisan forge-status:test --status=failed

This command will test all package functionality including cache storage, webhook endpoint, and status endpoint.

Test with your data

# Test with the provided data
php artisan forge-status:test --status=success

Then open your Laravel app in the browser to see the overlay in action!

Debugging

Check if routes are registered

php artisan forge-status:routes

This command will show you all registered Forge Status routes and verify they're working correctly.

Manual route discovery

If routes aren't auto-registered, run:

php artisan package:discover

Troubleshooting

Laravel 12 Compatibility Issues

If you encounter issues with Laravel 12, ensure you have:

  1. PHP 8.2+ installed
  2. Updated dependencies - run composer update
  3. Cleared caches - run php artisan config:clear && php artisan cache:clear

Polling Not Working

Make sure you have:

  1. Polling interval configured in your .env:

    FORGE_POLL_INTERVAL=5
  2. Status endpoint is accessible at /forge-status

  3. Cache is working - check your cache configuration

Webhook Not Receiving Data

Verify:

  1. Webhook URL is correctly registered in Laravel Forge
  2. Token verification is properly configured (if using)
  3. Route is accessible - check /forge-webhook endpoint

License

MIT License. See LICENSE file for details.

Author

Fakhar Zaman Khan - SoftPyramid

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

softpyramid/forge-status 适用场景与选型建议

softpyramid/forge-status 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 51 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 10 月 23 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「real-time」 「laravel」 「deployment」 「webhook」 「status」 「forge」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 softpyramid/forge-status 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 softpyramid/forge-status 我们能提供哪些服务?
定制开发 / 二次开发

基于 softpyramid/forge-status 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 51
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 18
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-10-23