penobit/crash-reporter

There is no license information available for the latest version (v0.4.1) of this package.

Penobit's Crash Reporter will notify crash reports via email and HTTP requests to your api.

v0.4.1 2023-08-12 13:48 UTC

This package is auto-updated.

Last update: 2024-11-12 16:39:14 UTC


README

Laravel crash reporter library will notify you about any uncaught exceptions in your laravel application by Sending you an email or making a POST/GET HTTP request to an endpoint

Installation

You can install Laravel Crash Reporter package simply using the Composer Just execute following command:

php composer require penobit/crash-reporter

after compoer downloaded and installed the package you should publish it's config file, To do that run following cmd

php artisan vendor:publish --tag config

This cmd will publish a new file crash-reporter.php to your app/config directory

Configuration

Laravel crash reporter is completely configurable. it's configurable using .env file or directly from crash-reporter.php file. The .env file is our recommended way yo configure the crash reporter

*1 Please Note! The token will be sent in two different ways based on HTTP request method:

  • GET: the token will be added to the url's query string like: api.penobit.com/report/crash?token=MY_TOKEN_FROM_ENV_FILE
  • POST: the token will be sent as an authorization bearer header: Authorization: Bearer MY_TOKEN_FROM_ENV_FILE

Customizations

You can customize the email template by creating a new template in your views directory. just create your custom email template template in this path: /resources/views/vendor/penobit/crash-reporter/crash-reporter-mail.blade.php and the crash reporter uses that instead of the default email template. You can also use these $data variable that is an object containing the exceptions details:

  • $data->message: Exception message
  • $data->file: File where exception was thrown
  • $data->line: Line where exception was thrown
  • $data->trace: Exception trace
  • $data->url: URL where exception was thrown
  • $data->body: Request body
  • $data->ip: IP address of the user
  • $data->method: Request method
  • $data->userAgent: Users's User agent
  • $data->browser: User's browser name
  • $data->browser_logo: User's browser logo base64 encoded URI
  • $data->os: User's OS name
  • $data->os_logo: User's OS logo base64 encoded URI