https://github.com/devdavido/laravel-reporto
Report browser errors to the server with the W3C Reporting API
https://github.com/devdavido/laravel-reporto
backend browser browser-interventions crash-report csp csp-violation deprecations feature-policy frontend laravel network-error report-api
Last synced: about 1 month ago
JSON representation
Report browser errors to the server with the W3C Reporting API
- Host: GitHub
- URL: https://github.com/devdavido/laravel-reporto
- Owner: DevDavido
- License: mit
- Created: 2018-09-08T17:45:47.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2026-01-01T11:51:47.000Z (4 months ago)
- Last Synced: 2026-01-06T10:16:54.679Z (4 months ago)
- Topics: backend, browser, browser-interventions, crash-report, csp, csp-violation, deprecations, feature-policy, frontend, laravel, network-error, report-api
- Language: PHP
- Size: 55.7 KB
- Stars: 12
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
# Reporto: Report browser errors to the server
[](https://github.com/DevDavido/laravel-reporto/releases)
[](https://github.com/DevDavido/laravel-reporto/actions/workflows/tests.yml)
[](https://scrutinizer-ci.com/g/DevDavido/laravel-reporto/)
[](https://packagist.org/packages/DevDavido/laravel-reporto)
This package makes use of the [W3C Reporting API](https://w3c.github.io/reporting/) and provides an easy plug-and-play package for your existing project. It will automatically add the necessary Report HTTP headers and log all configured browser errors to your Laravel backend.
## Documentation
Find yourself stuck using the package? Found a bug? Do you have general questions or suggestions for improving this package? Feel free to [create an issue on GitHub](https://github.com/devdavido/laravel-reporto/issues), we'll try to address it as soon as possible.
If you've found a bug regarding security please mail github{at}diskoboss{døt}de instead of using the issue tracker.
## Minimum requirements
- PHP 8.0+
- Laravel 9+
For support of older PHP / Laravel versions, check out previous releases of this package.
## Installation
You can install this package via composer using this command:
```bash
composer require devdavido/laravel-reporto
```
The package will automatically register itself and add a `Report-To` header to your `web` routes.
Each error or violation will be logged to the backend.
You can publish the config-file with:
```bash
php artisan vendor:publish --provider="DevDavido\Reporto\ReportoServiceProvider" --tag="config"
```
This is the contents of the published config file:
```php
return [
/*
* Use this setting to enable the reporting API header
*/
'enabled' => env('REPORTING_API_ENABLED', true),
/*
* Enables the reporting API for all subdomains
*/
'include_subdomains' => env('REPORTING_API_INCLUDE_SUBDOMAINS', false),
/*
* Exclude certain source files from being logged
*/
'exclude_source_files' => env('REPORTING_API_EXCLUDE_SOURCE_FILES', ['chrome-extension://*']),
/*
* Defines cached lifetime of all endpoint in seconds (86400s = 1 day)
*/
'endpoint_max_age' => env('REPORTING_API_MAX_AGE', 86400),
/*
* Which types of browser errors to report
* @see https://w3c.github.io/reporting/
*/
'groups' => [
'default',
'csp-endpoint',
'network-errors'
],
/*
* If you want to set the logging route prefix
*/
'route_prefix' => 'log'
];
```
## Support me
If you installed the package and it was useful for you or your business, please don't hesitate to make a donation. Thank you!
## Testing
You can run the tests with:
```bash
vendor/bin/phpunit
```
## Ideas / ToDo
- Daily/weekly reports via email
- Multiple endpoints
- More unit tests
## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
## Security
If you discover any security related issues, please email github{at}diskoboss{døt}de instead of using the issue tracker.
## Credits
- [Freek Van der Herten](https://github.com/freekmurze) for letting me use his packages as boilerplate.
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.