coedevtech/fixit
最新稳定版本:v1.9.0
Composer 安装命令:
composer require coedevtech/fixit
包简介
A Laravel package that captures and logs all exceptions into a database table — with optional encryption, email alerts, and a powerful CLI interface. Designed to give you full visibility into unhandled errors, without clutter or guesswork
README 文档
README
fixIt is a Laravel package that captures and logs all exceptions into a database table — with optional encryption, email or Slack alerts, and a powerful CLI interface. Designed to give you full visibility into unhandled errors, without clutter or guesswork.
🚀 Features
- ✅ Logs all unhandled exceptions to the database
- 🔐 Optional field-level encryption using Laravel Crypt
- 📧 Multi-recipient email alerts support
- ⚙️ Configurable notification system (email + Slack supported)
- 🧠 AI-powered fix suggestions (optional)
- 🌪️ Built-in Pest tests
- 📊 Artisan CLI:
fixit:reportto view, filter, and fix errors - ✍️
fixit:sync-configto merge missing config keys - 🛠️
fixit:sync-migrationsto publish and run package migrations - 🧪
fixit:verify-configto validate and auto-patch.env - 💡 Extensible alert interface (plug your own Discord, webhook, etc.)
🧩 Requirements
| Dependency | Version |
|---|---|
| PHP | ^8.1, ^8.2, or ^8.3 |
| Laravel | ^10.x, ^11.x, or ^12.x |
📦 Installation
composer require coedevtech/fixit
Then publish and install:
php artisan fixit:install
During installation, you’ll be prompted to enable encryption (optional). If enabled, a FIXIT_ENCRYPTION_KEY will be added to your .env file.
⚙️ Configuration
Publish the configuration file:
php artisan vendor:publish --tag=fixit-config
To check for missing config keys later, run:
php artisan fixit:sync-config
To verify and auto-patch missing .env keys:
php artisan fixit:verify-config php artisan fixit:verify-config --fix
To automatically append missing keys using short [] array syntax:
php artisan fixit:sync-config --write
For JSON output (CI pipelines):
php artisan fixit:verify-config --json
🔐 Manual Encryption / Decryption
fixIt provides two static methods via its facade to manually encrypt or decrypt data:
Encrypt data
use Fixit\Facades\Fixit; $encrypted = Fixit::encrypt(['email' => 'user@example.com']);
This encrypts any string or array using AES-256-CBC with a secure IV and stores it base64-encoded.
Decrypt data
$decrypted = Fixit::decrypt($encrypted);
This will return the original value (array or string), decrypted securely.
🗃️ Database Table
Includes fields like:
idurlrequestresponseipexceptionfilelinetracefingerprintoccurrenceslast_seen_atenvironmentstatus(not_fixed,fixed)created_at,updated_at
Table name is not configurable.
⚒️ Publishing Migrations
To publish and run any new package-provided migrations (e.g. adding new columns):
php artisan fixit:sync-migrations
This ensures that columns like fingerprint, last_seen_at, and occurrences are always present.
📧 Email Notifications
To receive an email when an error is logged:
- Set
send_on_errortotrue - Set the
notifications.emailin the config file - Ensure Laravel mail is properly configured
🧠 If you're using
QUEUE_CONNECTION=databaseorQUEUE_CONNECTION=redis, you must run:php artisan queue:workOtherwise, queued emails will not be sent and may block request execution depending on your queue setup.
Configure in .env:
FIXIT_SEND_EMAIL=true FIXIT_NOTIFICATION_EMAIL=admin@example.com,dev@example.com FIXIT_ALLOW_MULTIPLE_EMAILS=true
Emails will be sent to all valid addresses if
FIXIT_ALLOW_MULTIPLE_EMAILSis true.
🧠 AI Suggestions (Optional)
fixIt supports AI-powered suggestions for fixing logged errors. This is completely optional.
Enable AI-powered suggestions:
FIXIT_AI_ENABLED=true FIXIT_AI_API_KEY=sk-xxx # or use FIXIT_AI_API_URL FIXIT_AI_PROVIDER=openai # or fixit-proxy, groq, etc. FIXIT_AI_MODEL=gpt-3.5-turbo # or gpt-4 based on your provider FIXIT_AI_API_URL=https://www.proxy-url.com # Used for fixit-proxy
If enabled, suggestions are included in:
- 📧 Email alerts
- 💬 Slack alerts
- Future CLI/reporting support
🧪 Running Tests
./vendor/bin/pest
All tests are written using Pest and cover encryption, logging, config, and notifications.
🖥️ CLI Usage
View error logs:
php artisan fixit:report
Filter errors:
php artisan fixit:report --status=fixed php artisan fixit:report --all
Mark error as fixed:
php artisan fixit:report --fix=3
Sync and patch your config file:
php artisan fixit:sync-config # show missing keys php artisan fixit:sync-config --write # append missing keys to config/fixit.php
Publish and apply package migrations:
php artisan fixit:sync-migrations
🔌 Extending Alerts
You can bind your own alert channel by implementing the Fixit\Contracts\FixitAlertInterface.
Example for Slack, Discord, or webhook alerts:
use Fixit\Contracts\FixitAlertInterface; class SlackAlert implements FixitAlertInterface { public function send(string $message, ?Throwable $exception = null, ?string $suggestion = null): void { // Your logic here } }
Then bind it in a service provider:
app()->bind(FixitAlertInterface::class, SlackAlert::class);
🛡️ Security & Best Practices
- Uses Laravel’s encryption system
- Avoids session or user tracking by default
- Decoupled and test-driven design
- Ready to extend with custom drivers or UI layers
📝 Changelog
See Releases for full changelog.
coedevtech/fixit 适用场景与选型建议
coedevtech/fixit 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 243 次下载、GitHub Stars 达 7, 最近一次更新时间为 2025 年 06 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「logging」 「debugging」 「laravel」 「error logger」 「exception logger」 「fixit」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 coedevtech/fixit 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 coedevtech/fixit 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 coedevtech/fixit 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PHP package that takes a snapshot of your application and allows you to retrieve it later to help with debugging.
A Zend Framework module that sets up Monolog for logging in applications.
Laravel Database Query Logger and debug helper.
Asynchronous Sentry for Symfony - Fire and forget
Stackdriver handler for Monolog (codeinternetapplications/monolog-stackdriver Fork).
High-performance, zero-dependency PSR-3 logger for MonkeysLegion with structured logging, handlers, processors, and PHP 8.4 features.
统计信息
- 总下载量: 243
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 20
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-06-13