{"id":33951791,"url":"https://github.com/understand/understand-laravel","last_synced_at":"2026-04-02T02:08:14.266Z","repository":{"id":29317600,"uuid":"32851035","full_name":"understand/understand-laravel","owner":"understand","description":"Laravel 5, 6, 7 and 8 service provider for Understand.io","archived":false,"fork":false,"pushed_at":"2025-06-14T08:25:16.000Z","size":322,"stargazers_count":24,"open_issues_count":0,"forks_count":14,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-14T07:51:07.945Z","etag":null,"topics":["exception-handler","laravel","laravel-exceptions","laravel-logs","logs","php"],"latest_commit_sha":null,"homepage":"https://www.understand.io/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/understand.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-03-25T08:12:41.000Z","updated_at":"2025-06-14T08:21:16.000Z","dependencies_parsed_at":"2024-06-19T05:39:04.667Z","dependency_job_id":null,"html_url":"https://github.com/understand/understand-laravel","commit_stats":{"total_commits":140,"total_committers":7,"mean_commits":20.0,"dds":"0.17142857142857137","last_synced_commit":"473bd642b286c84945a93054bb554f4a08993ad9"},"previous_names":["understand/understand-laravel5"],"tags_count":45,"template":false,"template_full_name":null,"purl":"pkg:github/understand/understand-laravel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/understand%2Funderstand-laravel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/understand%2Funderstand-laravel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/understand%2Funderstand-laravel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/understand%2Funderstand-laravel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/understand","download_url":"https://codeload.github.com/understand/understand-laravel/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/understand%2Funderstand-laravel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31294398,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T01:43:37.129Z","status":"online","status_checked_at":"2026-04-02T02:00:08.535Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["exception-handler","laravel","laravel-exceptions","laravel-logs","logs","php"],"created_at":"2025-12-12T19:06:27.227Z","updated_at":"2026-04-02T02:08:14.243Z","avatar_url":"https://github.com/understand.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Laravel 5, 6, 7, 8, 9, 10, 11 and 12 integration for Understand.io\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/understand/understand-laravel5.svg?style=flat-square)](https://packagist.org/packages/understand/understand-laravel5)\n[![Quality Score](https://img.shields.io/scrutinizer/g/understand/understand-laravel5.svg?style=flat-square)](https://scrutinizer-ci.com/g/understand/understand-laravel5)\n[![Total Downloads](https://img.shields.io/packagist/dt/understand/understand-laravel5.svg?style=flat-square)](https://packagist.org/packages/understand/understand-laravel5)\n\n### Introduction\n\nThis packages provides a full abstraction for Understand.io and provides extra features to improve Laravel's default logging capabilities. It is essentially a wrapper around Laravel's event handler to take full advantage of Understand.io's data aggregation and analysis capabilities.\n\n### Quick start\n\n1. Add the package to your project\n    \n```\ncomposer require understand/understand-laravel\n```\n\n2. Add the ServiceProvider to the `providers` array in `config/app.php`\n  \n```php\nUnderstand\\UnderstandLaravel5\\UnderstandLaravel5ServiceProvider::class,\n```\n\n3. Set your Understand.io input token in your `.env` file\n  \n```php\nUNDERSTAND_ENABLED=true\nUNDERSTAND_TOKEN=your-input-token-from-understand-io\n```\n\n4. Send your first error\n\n```php \n// anywhere inside your Laravel app\n\\Log::error('Understand.io test error');\n```\n\n- We recommend that you make use of a async handler - [How to send data asynchronously](#how-to-send-data-asynchronously)  \n- If you are using Laravel 5.0 (`\u003e= 5.0, \u003c 5.1`) version, please read about - [How to report Laravel 5.0 exceptions](#how-to-report-laravel-50--50--51-exceptions).\n- For advanced configuration please read about - [Advanced configuration](#advanced-configuration)\n- JavaScript Error Tracking for Laravel - [Understand.io JavaScript library](https://www.understand.io/docs/1.0/laravel/js)\n\n\n### How to send events/logs\n\n#### Laravel logs\nBy default, Laravel automatically stores its [logs](http://laravel.com/docs/errors#logging) in `storage/logs`. By using this package, your log data will also be sent to your Understand.io channel. This includes error and exception logs, as well as any log events that you have defined (for example, `Log::info('my custom log')`).\n\n```php \n\\Log::info('my message', ['my_custom_field' =\u003e 'my data']);\n```\n#### PHP/Laravel exceptions\nBy default, all errors and exceptions with code fragments and stack traces will be sent to Understand.io. \n\nThe following extra information will be collected:\n\n| Type | Default | Config Key | Config Options |\n| --- | --- | --- | --- |\n| SQL queries | Enabled | `UNDERSTAND_SQL=` | `true` or `false` |\n| SQL query values/bindings | Disabled | `UNDERSTAND_SQL_BINDINGS=` | `true` or `false` |\n| HTTP request query string data | Enabled | `UNDERSTAND_QUERY_STRING=` | `true` or `false` |\n| HTTP request form or JSON data | Enabled | `UNDERSTAND_POST_DATA=` | `true` or `false` |\n\nAdditionally, you can specify which HTTP request field values should not be sent to Understand.io.\nBy default, the following field values will be hidden: \n```\nUNDERSTAND_HIDDEN_REQUEST_FIELDS=password,password_confirmation,access_token,secret_key,token,access_key\n```\n\nIf you wish you can publish the configuration file and make desired adjustments. See [Advanced configuration](#advanced-configuration)\n\n### How to send data asynchronously\n\n##### Async handler\nBy default each log event will be sent to Understand.io's api server directly after the event happens. If you generate a large number of logs, this could slow your app down and, in these scenarios, we recommend that you make use of an async handler. To do this, set the config parameter `UNDERSTAND_HANDLER` to `async` in your `.env` file.\n\n```php\n# Specify which handler to use - sync, queue or async. \n# \n# Note that the async handler will only work in systems where \n# the CURL command line tool is installed\nUNDERSTAND_HANDLER=async\n```\n\nThe async handler is supported in most systems - the only requirement is that the CURL command line tool is installed and functioning correctly. To check whether CURL is available on your system, execute following command in your console:\n\n```\ncurl -h\n```\n\nIf you see instructions on how to use CURL then your system has the CURL binary installed and you can use the ```async``` handler.\n\n\u003e Keep in mind that Laravel allows you to specify different configuration values in different environments. You could, for example, use the async handler in production and the sync handler in development.\n\n### How to report Laravel 5.0 (`\u003e= 5.0, \u003c 5.1`) exceptions \n\nLaravel's (`\u003e= 5.0, \u003c 5.1`) exception logger doesn't use event dispatcher (https://github.com/laravel/framework/pull/10922) and that's why you need to add the following line to your `Handler.php` file (otherwise Laravel's exceptions will not be sent Understand.io).\n\n- Open `app/Exceptions/Handler.php` and put this line `\\UnderstandExceptionLogger::log($e)` inside `report` method.\n  \n  ```php\n  public function report(Exception $e)\n  {\n      \\UnderstandExceptionLogger::log($e);\n\n      return parent::report($e);\n  }\n  ```\n \n \n### Advanced Configuration\n\n1. Publish configuration file\n\n```\nphp artisan vendor:publish --provider=\"Understand\\UnderstandLaravel5\\UnderstandLaravel5ServiceProvider\"\n```\n\n### Log Filter\nTo filter out specific log types a custom log filter can be provided.\n\n**Example filter class**\n```php\n// app/Logging/UnderstandLogFilter.php\n\u003c?php\n\ndeclare(strict_types=1);\n\nnamespace App\\Logging;\n\nuse Illuminate\\Support\\Str;\n\nclass UnderstandLogFilter\n{\n    public function __invoke($level, $message, $context): bool\n    {\n        if ($level === 'warning' \u0026\u0026 Str::contains(strtolower($message), 'deprecated')) {\n            return true;\n        }\n\n        return false;\n    }\n}\n```\nand then it can be configured in `understand-laravel.php`\n```php\n\u003c?php\n// ...\n// config/understand-laravel.php\n'log_filter' =\u003e \\App\\Logging\\UnderstandLogFilter::class,\n```\n\nThe `log_filter` config value must be a callable type:\n- https://www.php.net/manual/en/function.is-callable.php  \n  or a callable dependency from the service container:\n- https://laravel.com/docs/9.x/container#the-make-method\n\nThe suggested way would be to create an invokable class since it's hard to serialise anonymous functions (Laravel config cache):\n- https://www.php.net/manual/en/language.oop5.magic.php#object.invoke\n\nThe log filter interface must be as follows: `$callable($level, $message, $context)`.\nThe result of the filter must be a boolean value:\n- `TRUE`, the log should be ignored and NOT delivered to Understand.io\n- `FALSE`, the log should be delivered to Understand.io\n\nThe `ignored_logs` config value has higher precedence than `log_filter`.\n\n\n### Requirements \n##### UTF-8\nThis package uses the json_encode function, which only supports UTF-8 data, and you should therefore ensure that all of your data is correctly encoded. In the event that your log data contains non UTF-8 strings, then the json_encode function will not be able to serialize the data.\n\nhttp://php.net/manual/en/function.json-encode.php\n\n### License\n\nThe Laravel Understand.io service provider is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funderstand%2Funderstand-laravel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funderstand%2Funderstand-laravel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funderstand%2Funderstand-laravel/lists"}