Skip to content

codex-team/hawk.laravel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project is currently in the testing phase and may undergo changes.

Hawk Laravel

Laravel errors Catcher for Hawk.so.

Setup

  1. Register an account, create a Project and get an Integration Token.

  2. 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