PHP code example of irabbi360 / laravel-log-notifier
1. Go to this page and download the library: Download irabbi360/laravel-log-notifier library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;
use Irabbi360\LaravelLogNotifier\LogNotifierWatcher;
return Application::configure(basePath: dirname(__DIR__))
->withConfiguration()
->withRouting()
->withMiddleware(function (Middleware $middleware) {
// ... your middleware
})
->withExceptions(function (Exceptions $exceptions) {
// Register Log Notifier exception handler
LogNotifierWatcher::handles($exceptions);
})
->create();
// Any unhandled exception will trigger a toast notification
throw new Exception('Something failed!');
// Database errors
DB::connection()->getPdo();
// Model validation errors
User::findOrFail($invalidId);
// Any other exception in your app...