Download the PHP package honeybadger-io/nova-honeybadger without Composer
On this page you can find all versions of the php package honeybadger-io/nova-honeybadger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download honeybadger-io/nova-honeybadger
More information about honeybadger-io/nova-honeybadger
Files in honeybadger-io/nova-honeybadger
Package nova-honeybadger
Short Description Show Honeybadger errors within Laravel Nova.
License MIT
Informations about the package nova-honeybadger
Honeybadger Tool for Laravel Nova
This package displays Honeybadger errors for resources in Laravel Nova. By default, it shows all of the exceptions each user has encountered in your Laravel app.
With search strings, you can display errors for any resource.
Installation
You can install the package in to a Laravel app that uses Nova via composer:
Next, define your Honeybadger Project ID and Authentication Token inside your config/services.php
file, like this:
You can get your Project ID from the URL of your Honeybadger project:
https://app.honeybadger.io/projects/[ID]/faults
Your Authentication Token is available on your Honeybadger profile page (Note: this is different from your project's API key).
Usage
To display the Honeybadger faults that are associated with a given Nova resource, you need to add the Honeybadger Resource Tool to your resource.
To display all errors that are associated with a given Laravel User, all you need to do is add the resource tool to the fields
method of your User resource.
For example, in your app/Nova/User.php
file:
This will automatically search Honeybadger for faults with the resource's User ID.
Note: Make sure you also configure Honeybadger to identify users in Laravel.
Defining Custom Context Using Resource Attributes
If you want to search for a different context key/value pair, you can create the resource tool using the fromContextKeyAndAttribute
method.
This will tell Honeybadger to search for a specific context attribute and use the resource's column as the value.
For example, let's filter our Honeybadger faults by using the resource's email attribute:
Defining Custom Context
To search your Honeybadger faults using a custom context key and a static value, you may use the fromContextKeyAndValue
method.
It works similar to withContextKeyAndAttribute
, but will use the second parameter as a static string, instead of looking it up as a resource attribute.
Custom Search String
To get full control over your Honeybadger search string, you may use the fromSearchString
method on the resource tool. This let's you define a completely custom search string, that will be used to lookup your Honeybadger faults.
If you only want to append a custom search string to your context attributes, you may use the withSearchString
method in combination with the other methods:
Testing
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Credits
- All Contributors
License
The MIT License (MIT). Please see License File for more information.