8000 GitHub - HtunMyintWinn/lapse: Laravel Self Hosted Tiny Error Tracking System
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

HtunMyintWinn/lapse

 
 

Example

Introducing

Lapse provides a beautiful dashboard to track your errors in production without having to look up log file. Moreover it can notify you via Slack channel and Email alert. In future, I will add more channels.

Install

Install Via Composer

$ composer require pyaesone17/lapse

Publish vendor

$ php artisan vendor:publish

Add slack hook url in config/lapse.php and define channels

  'slack_channel' => 'https://hooks.slack.com/services/......',
    // Currently three notification channels supported
    // Those are database, slack and email
    'via' => ['database', 'slack']
$ php artisan vendor:publish

Migrate notification table

php artisan notifications:table
php artisan migrate

Usage

after that register In the report method like this.

    use Pyaesone17\Lapse\ErrorNotifiable;
    
    ..
    
    class Handler extends ExceptionHandler
    {
        use ErrorNotifiable;

        ...
    
        public function report(Exception $exception)
        {
            if( app()->environment()!='local' ){ // Remove this line if you want lapse to notify in local environment
                $this->sendNotification($exception, function ()
                {
                    // Here you must provide one user,
                    // It can be super admin, admin or normal user,
                    // Anything but at least you have to provide one model
                    // It is require for database notification
                    // and it must be notifiable object, it means class must use
                    // Illuminate\Notifications\Notifiable trait
                    return \App\User::first();
                });
            }
        }
        
        ...
        
    }

Laravel Lapse's dashboard is inspired by Laravel Horizon. Just like Horizon you can configure authentication to Lapse's dashboard. Add the following to the boot method of your AppServiceProvider. Here you could also check role permision and limit the dasboard.

    \Pyaesone17\Lapse\Lapse::auth(function($request) {
        // return true / false . For e.g.
        return \Auth::check();
    });

To view the dashboard point your browser to /lapse of your app. For e.g. laravel.dev/lapse. But the app is in local environment, lapse will not even attend to validate auth, It will display it all.

Currently deleting lapse message doesn't support via UI. To delete all lapse message please run

$ php artisan clear:lapse

Security

If you discover any security related issues, please email promise@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

Laravel Self Hosted Tiny Error Tracking System

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.md

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 52.0%
  • JavaScript 40.3%
  • HTML 7.7%
0