timacdonald / pulse-validation-errors
Validation errors card for Laravel Pulse
Installs: 2 083
Dependents: 0
Suggesters: 0
Security: 0
Stars: 47
Watchers: 2
Forks: 5
Open Issues: 2
Requires
- php: ^8.1
- laravel/pulse: ^1.0
Requires (Dev)
- inertiajs/inertia-laravel: ^1.0
- orchestra/testbench: ^9.0
- pestphp/pest: ^2.0
- pestphp/pest-plugin-laravel: ^2.2
README
A card for Laravel Pulse to show validation errors impacting users.
Installation
First, install the package via composer:
composer require timacdonald/pulse-validation-errors
Next, add the recorder to your config/pulse.php
:
return [ // ... 'recorders' => [ TiMacDonald\Pulse\Recorders\ValidationErrors::class => [ 'enabled' => env('PULSE_VALIDATION_ERRORS_ENABLED', true), 'sample_rate' => env('PULSE_VALIDATION_ERRORS_SAMPLE_RATE', 1), 'capture_messages' => true, 'ignore' => [ // '#^/login$#', // '#^/register$#', // '#^/forgot-password$#', ], ], // ... ], ];
Warning
Make sure to configure the sample_rate
for your application. This card may capture a lot of data if you have a lot of users hitting validation errors.
Next, add the card to your resources/views/vendor/pulse/dashboard.php
:
<x-pulse> <livewire:pulse.validation-errors cols="8" rows="4" /> <!-- ... --> </x-pulse>
Finally, get to improving your user experience. At LaraconUS I gave a talk on how much our validation sucks. If you are here, you likely also care about how your users experience validation errors on your app, so I'd love you to give it a watch.
Features
- Supports multiple error bags
- Supports session based validation errors
- Supports API validation errors
- Support Inertia validation errors
- Support Livewire validation errors
- Fallback for undetectable validation errors (based on 422 response status)