定制 haevol/laravel-openproject-feedback 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

haevol/laravel-openproject-feedback

Composer 安装命令:

composer require haevol/laravel-openproject-feedback

包简介

Laravel package for collecting user feedback and automatically creating work packages in OpenProject

README 文档

README

Latest Version Total Downloads License

PHP Version Laravel Version

A beautiful, customizable feedback widget for Laravel applications that automatically creates work packages in OpenProject. Collect user feedback, bug reports, and feature requests directly from your application and seamlessly integrate them into your OpenProject workflow.

Developed by Haevol

✨ Features

  • 🎯 Zero Configuration - Works out of the box with sensible defaults
  • 🎨 Fully Customizable - Position, colors, text, and behavior are all configurable
  • 📸 Screenshot Support - Users can attach screenshots to their feedback
  • 🔗 OpenProject Integration - Automatically creates work packages (bugs/tasks) in OpenProject
  • 🎭 Dark Mode Support - Beautiful dark mode styling included
  • 📱 Fully Responsive - Works perfectly on all screen sizes
  • 🔒 Authentication Ready - Optional authentication requirement
  • Lightweight - Minimal JavaScript footprint, no external dependencies
  • 🎨 Modern UI - Clean, modern design that fits any application

📋 Requirements

  • PHP ^8.1
  • Laravel ^10.0|^11.0|^12.0
  • OpenProject instance with API access
  • OpenProject API key

📦 Installation

Install the package via Composer:

composer require haevol/laravel-openproject-feedback

Publish Configuration

Publish the configuration file:

php artisan vendor:publish --tag=openproject-feedback-config

This will create config/openproject-feedback.php. Configure your OpenProject settings:

'openproject' => [
    'url' => env('OPENPROJECT_URL'),
    'api_key' => env('OPENPROJECT_API_KEY'),
    'project_id' => env('OPENPROJECT_PROJECT_ID'),
    'type_name' => env('OPENPROJECT_TYPE_NAME', 'Bug'),
    'status_name' => env('OPENPROJECT_STATUS_NAME', 'New'),
],

Environment Variables

Add to your .env file:

OPENPROJECT_URL=http://your-openproject-instance.com
OPENPROJECT_API_KEY=your-api-key
OPENPROJECT_PROJECT_ID=1
OPENPROJECT_TYPE_NAME=Bug
OPENPROJECT_STATUS_NAME=New

Publish Assets

Publish the JavaScript widget:

php artisan vendor:publish --tag=openproject-feedback-assets

This copies the widget to resources/js/vendor/openproject-feedback/.

Include in Your Layout

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

<x-openproject-feedback::feedback-widget />

Note: The widget uses @vite() for asset loading. Make sure your layout has a @stack('scripts') directive where scripts are loaded.

Compile Assets

Add to your vite.config.js:

import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';

export default defineConfig({
    plugins: [
        laravel({
            input: [
                'resources/js/app.js',
                'resources/js/vendor/openproject-feedback/feedback-widget.js', // Add this
            ],
        }),
    ],
});

Then compile:

npm run build

Or for development:

npm run dev

🎨 Configuration

Widget Appearance

Customize the widget in config/openproject-feedback.php:

'widget' => [
    'enabled' => true,
    'position' => 'bottom-left', // top-left, top-right, bottom-left, bottom-right
    'offset' => [
        'bottom' => 64,  // pixels from bottom
        'top' => 16,     // pixels from top
        'left' => 0,     // pixels from left
        'right' => 16,   // pixels from right
    ],
    'z_index' => 50,
    'color' => [
        'primary' => '#3b82f6',   // Tailwind blue-500
        'hover' => '#2563eb',     // Tailwind blue-600
    ],
    'text' => 'FEEDBACK',
    'show_only_authenticated' => true,
],

Routes Configuration

Customize the feedback submission route:

'routes' => [
    'enabled' => true,
    'prefix' => 'api',
    'middleware' => ['web', 'auth'],
],

Form Configuration

Configure form fields and validation:

'form' => [
    'subject' => [
        'required' => true,
        'max_length' => 255,
    ],
    'description' => [
        'required' => true,
        'max_length' => 5000,
    ],
    'screenshot' => [
        'enabled' => true,
        'max_size' => 5120, // KB
    ],
],

🚀 Usage

Once installed and configured, the widget will automatically appear on your pages (if show_only_authenticated is enabled, only for authenticated users).

How It Works

  1. User clicks the feedback button - A beautiful modal opens
  2. User fills the form - Title, description, and optional screenshot
  3. Form submission - Feedback is sent to your Laravel application
  4. OpenProject integration - A work package is automatically created in OpenProject
  5. User confirmation - User sees a success message

Customizing the Widget

You can customize the widget appearance by editing the published view:

php artisan vendor:publish --tag=openproject-feedback-views

This will publish the view to resources/views/vendor/openproject-feedback/components/feedback-widget.blade.php.

🔧 Advanced Usage

Programmatic Feedback Submission

You can also submit feedback programmatically:

use Haevol\OpenProjectFeedback\Services\OpenProjectService;

$service = app(OpenProjectService::class);

$result = $service->createWorkPackage([
    'subject' => 'Bug Report',
    'description' => 'Detailed description...',
    'project_id' => 1,
    'type_name' => 'Bug',
    'status_name' => 'New',
    'user' => [
        'id' => auth()->id(),
        'name' => auth()->user()->name,
        'email' => auth()->user()->email,
    ],
]);

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  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

📝 Changelog

Please see CHANGELOG for more information on what has changed recently.

🔒 Security

If you discover any security-related issues, please email info@haevol.org instead of using the issue tracker.

📄 License

The MIT License (MIT). Please see License for more information.

🙏 Credits

  • Developed by Haevol - A software development company specializing in Laravel applications and open-source solutions.
  • Built with ❤️ for the Laravel community

📚 Additional Resources

💬 Support

For issues and questions, please open an issue on GitHub.

⭐ Show Your Support

If you find this package useful, please consider giving it a ⭐ on GitHub!

haevol/laravel-openproject-feedback 适用场景与选型建议

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

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

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

围绕 haevol/laravel-openproject-feedback 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-12-09