jeremykenedy/laravel-exception-notifier
Laravel Exception Notifier sends real-time alerts when exceptions occur in your Laravel app, supporting email, Slack, and other channels. It helps developers catch errors quickly with configurable recipients and environment controls.
^8.0 (each Laravel version enforces its own higher minimum, so don't read the package constraint as "PHP 8.0 is enough on Laravel 13"). Laravel 7/8 must stay on 2.2.0; Laravel 6 and below on 1.2.0.composer require jeremykenedy/laravel-exception-notifier:"^5.0"
php artisan exception-notifier:install
The command scaffolds the missing pieces and prompts for an email layout (legacy or modern) and a theme (light, dark, or system). Defaults are the legacy layout and light theme — you get existing behaviour unless you opt in.config/exceptions.php configuration, a mailer class, the email view(s), and a Handler trait copied into your application. That trait is what actually hooks exception reporting into the framework's report() path — it is not auto-registered.config/exceptions.php and set the recipient address(es), from address, subject, and mailer connection.App\Exceptions\Handler (Laravel 9/10). On Laravel 11+ there is no default Handler class — create one or wire the reporting path in bootstrap/app.php first, otherwise the trait never runs and nothing is sent.MAIL_MAILER=log locally and trigger a real exception (throw new \Exception('test') from a route or php artisan tinker) to confirm the mail renders. Tune the mailer only after you've seen a message.config/exceptions.php (all supported keys and content fields), the published mailer class (subject/recipient logic and where you add context), the published view (layout markup), then docs/installation.md, docs/upgrading.md, and docs/testing.md in the repo.report() call thin and let configuration drive everything else. If you need custom routing logic (e.g. page the on-call only for 5xx in business hours), override in the mailer rather than editing the trait — the trait is a copied class you'll have to diff on every upgrade.AuthenticationException, 4xx HttpException, control-flow exceptions — into the don't-report list. V5 specifically fixed the copied trait's inherited-property conflict while preserving application exclusions, so re-check your exclusion list after upgrading; a copy that silently drops them is the classic failure mode.MAIL_MAILER=log locally, a shared dev mailbox on staging, real recipients in production. For staging, point to at a team alias rather than individuals so test storms don't page anyone.exceptions.emailExceptionView at your own Blade file and keep the data contract the package passes in. Note the consequence: a custom view is intentionally not touched by the update command, so upstream view fixes (like the mobile long-path overflow fix in the legacy layout) won't reach you automatically.emailExceptionTheme to light, dark, or system. system uses client-side prefers-color-scheme detection in the modern layout — great for dark-mode users, but you should still ship a readable light fallback for clients that ignore the media query.php artisan exception-notifier:update --layout=modern --theme=system --force
php artisan view:clear
--force is mandatory to overwrite an already-published view, and it will only proceed if the backup succeeds.composer update
php artisan exception-notifier:update --no-interaction
php artisan config:clear # or config:cache in your normal deploy flow
php artisan view:clear
Run it on staging first and git diff the published files — that's the only reliable way to see what changed under you.Cache::add("exc-notify:{$fingerprint}", ...)) keyed on exception class + file + line. This is the single highest-value addition on a high-traffic app.composer update will not fix them. The V5 mailer fixes and the Handler trait's property-conflict fix must be applied by hand to already-published copies, or by re-publishing selectively after backing up. Budget for this on every upgrade.emailExceptionTheme. Older published config predates the key, so theme selection silently does nothing. Add the key by hand rather than republishing over your customisations. Same story if you've cached config — rebuild after any change.--force discipline. The safety design is good (backup, preserve original on failed write, remove newly created files on failed install), but don't put --force in an automated pipeline. Overwriting a view is a code change; it deserves a diff and a commit.App\Exceptions\Handler means no trait, means no mail — and no error telling you so. Also verify your withExceptions configuration doesn't bypass the reporting path.exceptions.emailExceptionView, the V5 modern layout and the mobile long-path fix are opt-in via a manual port. Copy the new markup into your custom file when convenient.view:clear after layout/theme switches. Compiled Blade views will happily serve the old layout until you clear them. Same for config:clear/config:cache after editing theme or recipients.build() mail API including 9.20. If you've customised the Mailable with envelope()/content() only, test on the exact 9.x you run — the transitional releases are where mail-shape mismatches surface.prefers-color-scheme inconsistently. Always check the dark variant at both mobile and desktop widths — the package's own Chromium suite covers layout/theme/width/contrast, which is a good checklist to mirror manually.2.2.0 and ≤6 on 1.2.0 — if composer resolves something odd on an old app, check the framework constraint first, not PHP.How can I help you explore Laravel packages today?