Download the PHP package twisted-binary/laravel-feedback-widget without Composer
On this page you can find all versions of the php package twisted-binary/laravel-feedback-widget. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download twisted-binary/laravel-feedback-widget
More information about twisted-binary/laravel-feedback-widget
Files in twisted-binary/laravel-feedback-widget
Package laravel-feedback-widget
Short Description AI-powered feedback widget for Laravel + Inertia + Vue apps that creates GitHub issues.
License MIT
Informations about the package laravel-feedback-widget
Laravel Feedback Widget
An AI-powered feedback widget for Laravel + Inertia + Vue apps. Users describe bugs, feature requests, or general feedback through a guided chat — the AI structures it into a well-formatted GitHub issue automatically.
Features
- Guided chat — AI asks follow-up questions to gather the right details for each feedback type (bug, feature, feedback)
- Auto-structured issues — Produces well-formatted GitHub issues with proper sections (Steps to Reproduce, Expected Behavior, etc.)
- Screenshot uploads — Users can paste or attach screenshots for bug reports
- Star ratings — Optional 5-star rating for general feedback
- GitHub App auth — Uses GitHub App installation tokens (not PATs) for secure issue creation
- Zero config UI — Drop
<FeedbackWidget />into any layout; routes, bindings, and Inertia props are handled by the service provider - AI cost tracking — Per-request token usage logged to a
feedback_ai_coststable with conversation-level grouping
Requirements
- PHP 8.4+
- Laravel 12+
- Inertia.js v2 (Vue 3)
- An OpenAI API key
- A GitHub App with issue write permissions
Installation
1. Composer
2. Vite config
The Vue components ship as raw SFCs inside the Composer package. Add a resolve alias so Vite can find them:
3. Publish config (optional)
This publishes config/feedback-widget.php where you can customize routes, middleware, throttling, and more.
4. Publish and run migrations (optional)
AI cost tracking is enabled by default. To create the feedback_ai_costs table:
To disable cost tracking entirely, set FEEDBACK_WIDGET_TRACK_AI_COSTS=false in your .env.
OpenAI API Setup
This package uses the OpenAI API to power the guided feedback chat. Here's how to get set up:
1. Create an OpenAI account
Go to platform.openai.com and sign up or log in.
2. Add billing
Navigate to Settings → Billing and add a payment method. The API is pay-per-use — the default gpt-4o-mini model is very affordable for short feedback conversations.
3. Generate an API key
Go to API keys (platform.openai.com/api-keys) → Create new secret key.
Give it a name (e.g. feedback-widget) and copy the key — you won't be able to see it again.
4. Add to your .env
The OPENAI_FEEDBACK_MODEL setting is optional. gpt-4o-mini is the default and works well for feedback conversations. You can switch to gpt-4o for higher quality responses at a higher cost.
GitHub App Setup
This package uses a GitHub App (not a personal access token) to create issues. Here's how to set one up:
1. Create the GitHub App
Go to github.com/settings/apps/new and configure:
| Field | Value |
|---|---|
| App name | Something like myapp-feedback |
| Homepage URL | Your app URL |
| Webhook | Uncheck "Active" (not needed) |
| Permissions → Repository → Issues | Read & write |
| Where can this app be installed? | Only on this account |
Click Create GitHub App. Note the App ID shown on the next page.
2. Generate a private key
On the app settings page, scroll to Private keys → Generate a private key. A .pem file downloads.
3. Install the app on your repo
On the app settings page, click Install App in the left sidebar → Install on your account → select Only select repositories → pick your feedback repo → Install.
Note the Installation ID from the URL after installing:
4. Base64-encode the private key
Copy the output — you'll use it as GITHUB_APP_PRIVATE_KEY below.
Environment Variables
Add these to your .env:
Usage
Add the widget to your layout:
Note: The widget uses a singleton pattern — only one instance per page is supported.
That's it. The service provider automatically:
- Registers routes (
POST /feedback/chat,POST /feedback/issue) - Binds the chat and issue services
- Shares route URLs to the frontend via Inertia props
Configuration
The full config file (config/feedback-widget.php):
Multilanguage Support
AI Response Language (locale)
Set FEEDBACK_WIDGET_LOCALE in your .env to control the language the AI responds in. When not set, it falls back to app()->getLocale(). For English (en), no extra instruction is prepended to the AI prompt.
Per-user locale
Leave FEEDBACK_WIDGET_LOCALE unset and the widget will automatically use whatever locale your app has set for the current request. If you already set the locale per user via middleware (e.g. app()->setLocale($user->locale)), the AI will respond in that user's language with no extra configuration.
UI Translations (translations prop)
All UI strings have English defaults. To translate the widget, pass a translations prop with your overrides:
You only need to pass the strings you want to override — all others fall back to the English defaults. See the FeedbackTranslations interface for the full list of translatable strings.
Exports
The package exports:
| Export | Description |
|---|---|
FeedbackWidget |
Full widget with FAB button + chat panel (drop into layout) |
FeedbackChatPanel |
Chat panel only (if you want a custom trigger) |
useFeedbackChat |
Composable with all state and methods |
defaultTranslations |
Default English translations object |
FeedbackTranslations |
TypeScript interface for all translatable strings |
AI Cost Tracking
Every chat request logs token usage (prompt tokens, completion tokens, model) to the feedback_ai_costs table. Each conversation is grouped by a UUID conversation_id so you can aggregate usage per feedback session.
Query examples:
To disable, set track_ai_costs to false in your config or .env. No rows will be inserted and the migration is still publishable but optional.
Events
The package dispatches a FeedbackAiCostRecorded event after each AI chat request, allowing your application to react to AI usage (e.g. external billing, analytics, alerting).
Event properties
| Property | Type | Description |
|---|---|---|
userId |
?int |
Authenticated user ID, or null if guest |
model |
string |
AI model used (e.g. gpt-4o-mini) |
promptTokens |
int |
Input tokens consumed |
completionTokens |
int |
Output tokens consumed |
feedbackType |
string |
Feedback type (bug, feature, feedback) |
conversationId |
string |
UUID grouping messages in the same session |
createdAt |
Carbon |
Timestamp of the recorded cost |
Listening for the event
The event is dispatched synchronously. If you need async processing, dispatch a queued job from your listener.
How It Works
- User clicks the floating action button
- Selects feedback type (bug / feature / feedback)
- Chats with the AI assistant which guides them through the details
- AI produces a structured title + body and asks for confirmation
- On confirmation, a GitHub issue is created with proper labels
- User sees a success state
License
MIT
All versions of laravel-feedback-widget with dependencies
laravel/framework Version ^12.0|^13.0
openai-php/laravel Version >=0.10 <1.0
lcobucci/jwt Version ^5.0
inertiajs/inertia-laravel Version ^2.0|^3.0