j87nl / laravel-feedback
A feedback and bug report button for Laravel Inertia/Vue apps, with an annotated screenshot, recent JavaScript errors and a mail to the team
Requires
- php: ^8.4
- illuminate/contracts: ^12.0|^13.0
- inertiajs/inertia-laravel: ^2.0|^3.0
- spatie/laravel-package-tools: ^1.16
- tranquil-tools/laravel-form-builder: ^1.16
- tranquil-tools/laravel-vue-form-builder: ^1.21
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.14
- orchestra/testbench: ^10.0.0||^11.0.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
A feedback and bug report button for Laravel apps with Inertia and Vue 3.
A logged-in user clicks the round button in the corner. The package takes a screenshot of the visible page, opens a
dialog where the user can black out or highlight parts of it, and sends the message together with the page URL, the
viewport, the browser and the last JavaScript errors. The report is stored in feedback_reports and a queued job mails
it to the team with the screenshot attached.
- Backend: route, rate limiter, form (TranquilTools FormBuilder), model, migration, mailable, translations (nl, en, de).
- Frontend:
FeedbackButtonand a JavaScript error buffer, with their own minimal UI on Tailwind v4 and shadcn tokens.
Requirements
- PHP 8.4, Laravel 12 or 13,
inertiajs/inertia-laravel2 or 3 - A
userstable with an unsigned big integerid(the published migration usesforeignId('user_id')->constrained()) tranquil-tools/laravel-form-builderandtranquil-tools/laravel-vue-form-builder(the@form-builderalias)- npm:
vue,@inertiajs/vue3,reka-ui,@lucide/vueandmodern-screenshot(see thepeerDependenciesinpackage.json) - Tailwind CSS v4 with the shadcn colour tokens (
bg-background,text-muted-foreground,bg-primary, ...)
Quick start
composer require j87nl/laravel-feedback php artisan vendor:publish --tag=feedback-migrations php artisan migrate npm install --save-exact modern-screenshot@4.7.0
// app/Http/Middleware/HandleInertiaRequests.php use J87NL\Feedback\Feedback; return [ ...parent::share($request), ...Feedback::props($request), ];
// resources/js/app.ts import { initializeFeedbackErrorBuffer } from '@feedback/errorBuffer'; initializeFeedbackErrorBuffer();
<!-- your authenticated layout --> <script setup lang="ts"> import FeedbackButton from '@feedback/components/FeedbackButton.vue'; </script> <template> <slot /> <FeedbackButton /> </template>
FEEDBACK_MAIL_TO=support@example.com,dev@example.com
Reports and screenshots are kept forever unless you set FEEDBACK_RETENTION_DAYS and schedule model:prune for
J87NL\Feedback\Models\FeedbackReport, see retention.
The vite alias, tsconfig path and Tailwind @source line are in the installation docs.
Documentation
See docs/index.md.
Testing
composer test
composer analyse
composer format
License
MIT, see LICENSE.