softgala/laravel-claude-button
Composer 安装命令:
composer require softgala/laravel-claude-button
包简介
Adds an error copy button to Laravel 500 pages. Clipboard + VS Code integration for AI-assisted debugging.
关键字:
README 文档
README
A Laravel package that adds a one-click button to your error pages. Instantly copy error details to your clipboard and optionally open the file in VS Code. Perfect for AI-assisted debugging with ChatGPT, Claude, Copilot, or any AI assistant.
Features
- 🚀 One-Click Error Copying: Instantly copy error details to clipboard - ready to paste into any AI chat
- 📋 Smart Clipboard: Works in HTTP contexts without HTTPS (perfect for local development)
- 🔗 Optional VS Code Integration: Toggle to automatically open error file in VS Code
- 💾 File Export: Saves error details to
storage/app/claude-errors/latest-error.mdfor easy reference - 🎨 Clean UI: Beautiful, non-intrusive button that appears only on errors
- 🎛️ Settings Card: Toggle VS Code auto-open on/off (preference saved in browser)
- 🔒 Environment-Safe: Only shows in local/development environments
- 🤖 AI-Ready Format: Clean error message + file location - perfect for any AI assistant
- ⚙️ Zero Config: Works immediately after installation
Installation
Install the package via Composer:
composer require softgala/laravel-ai-debug-copy
The package will automatically register its service provider.
Configuration
Publish the configuration file (optional):
php artisan vendor:publish --tag=claude-button-config
This will create a config/claude-button.php file where you can customize:
return [ // Enable or disable the button 'enabled' => env('AI_DEBUG_BUTTON_ENABLED', true), // Only show in these environments 'environments' => ['local', 'development'], // Stack trace depth (0 = cleanest, just error + location) // Set to 3+ to include stack trace for deeper debugging 'trace_depth' => 0, ];
Note on trace_depth:
0(default): Shows only error message and file location - cleanest format for AI3+: Includes stack trace frames for additional context
Usage
Once installed, the package will automatically add a "Copy Error for AI" button to any 500 error pages in your allowed environments.
Testing
Visit the test route to see it in action:
http://your-app.test/error/test
How it Works
- When an error occurs, a settings card and button appear in the bottom-right corner
- Settings Card: Toggle "Open VS Code" on/off (preference saved in browser)
- Click the button to:
- Copy error details to clipboard (works in HTTP and HTTPS)
- Save error report to
storage/app/claude-errors/latest-error.md - Open VS Code at the exact line where the error occurred (if enabled)
- Paste into your AI assistant:
- Open ChatGPT, Claude, Copilot, or any AI chat
- Paste (Cmd+V / Ctrl+V) - error details already in clipboard
- Or open
storage/app/claude-errors/latest-error.mdand share the file
- Get instant AI-assisted debugging and solutions!
What Gets Copied
The button formats error information cleanly and concisely:
Test error message here
/path/to/file.php:123
That's it! Just the error message and file location. This clean format works perfectly with any AI assistant:
- ChatGPT, Claude, Copilot, or any AI tool
- Paste and get instant analysis
- AI understands the file path and line number
- No verbose formatting - straight to the point
Security
- The button only appears in local/development environments
- No data is sent to external servers
- All processing happens client-side
- VS Code opens via local
vscode://protocol
Requirements
- PHP 8.1 or higher
- Laravel 10.x, 11.x, or 12.x
- VS Code (optional, for auto-opening error files)
Publishing Views
To customize the button appearance, publish the views:
php artisan vendor:publish --tag=claude-button-views
This will create resources/views/vendor/claude-button/button.blade.php.
Error Files
The package automatically saves error details to:
storage/app/claude-errors/latest-error.md- Always contains the most recent errorstorage/app/claude-errors/latest-error-YYYY-MM-DD-HHMMSS.md- Timestamped backups
Old error files are automatically cleaned (keeps last 10).
Example error file:
Test error for AI debug button - This is a demo error! /path/to/file.php:123 --- *Error captured at: 2025-10-12 14:30:45* *Type: Exception*
These markdown files can be:
- Opened directly in VS Code
- Shared with any AI assistant via file upload or copy/paste
- Committed to your repo for team debugging
- Used for error documentation
Tips for Best Results
-
With Any AI Assistant:
- Click button, paste error into ChatGPT/Claude/Copilot/etc
- Error is already formatted and ready to go
- Get instant analysis and solutions
-
VS Code Toggle:
- Toggle "Open VS Code" OFF if you prefer clipboard only
- Your preference is saved in browser localStorage
- Perfect for quick copy without opening editor
-
Non-HTTPS Development:
- Works perfectly on
http://localhostor any HTTP context - Smart clipboard fallback ensures it always works
- No SSL certificate required
- Works perfectly on
-
Team Debugging:
- Share the
latest-error.mdfile with teammates - Everyone can paste the same error into their preferred AI tool
- Consistent error format across team
- Share the
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for details.
Security
If you discover any security-related issues, please email contact@softgala.com instead of using the issue tracker.
Changelog
Please see CHANGELOG.md for recent changes.
License
MIT-0 (MIT No Attribution). Use it however you want, no attribution required. Please see LICENSE for more information.
Credits
Support
- Issues: GitHub Issues
- Email: contact@softgala.com
- Website: softgala.com
softgala/laravel-claude-button 适用场景与选型建议
softgala/laravel-claude-button 是一款 基于 Blade 开发的 Composer 扩展包,目前已累计 8 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 10 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「debugging」 「laravel」 「error-handling」 「ai」 「laravel-package」 「developer-tools」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 softgala/laravel-claude-button 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 softgala/laravel-claude-button 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 softgala/laravel-claude-button 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Logging and Notifications for Laravel Console Commands.
A PHP package that takes a snapshot of your application and allows you to retrieve it later to help with debugging.
Laravel Database Query Logger and debug helper.
Enables simple 404 Page NotFound handling, also for multilingual sites.
Prevent sensitive exception details from leaking in Laravel applications
a package for handle api errors
统计信息
- 总下载量: 8
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 30
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT-0
- 更新时间: 2025-10-11
