codex-team / hawk.laravel
Laravel errors Catcher module for Hawk.so
Requires
- php: ^7.2 || ^8.0
- codex-team/hawk.php: ^2.2.5
- guzzlehttp/guzzle: ^6.0 || ^7.0
- guzzlehttp/psr7: ^2.1.1
- illuminate/support: ^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0 | ^11.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.19||^3.40
This package is auto-updated.
Last update: 2025-04-29 16:49:59 UTC
README
This project is currently in the testing phase and may undergo changes.
Hawk Laravel
Laravel errors Catcher for Hawk.so.
Setup
-
Register an account, create a Project and get an Integration Token.
-
Install SDK via composer to install the Catcher
- Catcher provides support for PHP 7.2 or later
- Your Laravel version needs to be 11.x or higher
Install command
$ composer require codex-team/hawk.laravel
To enable capturing unhandled exceptions for reporting to Hawk
, modify your bootstrap/app.php
file as follows:
<?php use Illuminate\Foundation\Application; use Illuminate\Foundation\Configuration\Exceptions; use Illuminate\Foundation\Configuration\Middleware; return Application::configure(basePath: dirname(__DIR__)) ->withRouting( web: __DIR__.'/../routes/web.php', commands: __DIR__.'/../routes/console.php', health: '/up', ) ->withMiddleware(function (Middleware $middleware) { // }) ->withExceptions(function (Exceptions $exceptions) { HawkBundle\Integration::handles($exceptions); })->create();
Register the Service Provider
To complete the setup, add the Hawk
service provider to your config/app.php
or bootstrap/providers.php
file in the providers array:
'providers' => [ // Other service providers... HawkBundle\ErrorLoggerServiceProvider::class, ],
Configuration
Set up Hawk using the following command:
$ php artisan hawkbundle:publish
This will create the configuration file (config/hawk.php
), and you can manually add the HAWK_TOKEN
in your .env
file:
HAWK_TOKEN=<your integration token>
Issues and improvements
Feel free to ask questions or improve the project.
Links
Repository: https://github.com/codex-team/hawk.laravel
Report a bug: https://github.com/codex-team/hawk.laravel/issues
Composer Package: https://packagist.org/packages/codex-team/hawk.laravel
CodeX Team: https://codex.so
License
MIT