tvup/laravel-fejlvarp is a Laravel package for simple incident logger for laravel.
It currently has 2 GitHub stars and 9.999 downloads on Packagist (latest version v12.3.0).
Install it with composer require tvup/laravel-fejlvarp.
Discover more Laravel packages by tvup
or browse all Laravel packages to compare alternatives.
Last updated
Laravel Fejlvarp is a robust incident logger tailored for Laravel applications. Designed to streamline error tracking, it ensures that you're always in the loop about runtime errors, allowing for swift resolution.
Why Choose Laravel Fejlvarp?
| Incidents overview | Incident detail view |
|------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------|
|
|
|
This package is an enchancement of Fejlvarp by troelskn. Thanks for letting me envolve on the idea to letting it become a package for laravel.
negoziator has also been a great help in the process of making this package.
This project supports a range of PHP and Laravel versions, tested across multiple operating systems. Below are the details of the supported versions:
| Laravel Version | PHP Versions | Required larastan/larastan | Required orchestra/testbench | Required orchestra/testbench-core |
|-----------------|----------------------|------------------------------|--------------------------------|-------------------------------------|
| 11.* | 8.3, 8.4 | 3.* | ^9.1 | 9.1.4 |
| 12.* | 8.3, 8.4 | 3.* | ^10.0 | 10.0.0 |
| 13.* | 8.3, 8.4, 8.5 | 3.* | ^11.0 | 11.0.0 |
The project is tested on the following operating systems:
The project is tested under different dependency scenarios to ensure robust compatibility:
You can install the package via composer:
composer require tvup/laravel-fejlvarp
Default route to list of incidents will be http://your-url.top/incidents
Important! Make sure to protect this route with (admin) authentication
You can enjoy the convenience of letting the package install itself.
php artisan fejlvarp:install
It will also ask you if you want to create (migrate) the table that will be storing the incidents
Instead of doing the above, or just if you are curious, you publish the files manually by doing the following:
You can publish and run the migrations with:
php artisan vendor:publish --tag="fejlvarp-migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="fejlvarp-config"
This is the contents of the published config file:
return [
'ipstack' => ['access_key' => env('INCIDENT_MANAGER_IPSTACK_ACCESS_KEY')],
'pushover' => [
'userkey' => env('INCIDENT_MANAGER_PUSHOVER_USER_KEY'),
'apitoken' => env('INCIDENT_MANAGER_PUSHOVER_API_TOKEN'),
],
'slack' => [
'webhook_url' => env('INCIDENT_MANAGER_SLACK_WEBHOOK_URL'),
],
'mail_recipient' => env('INCIDENT_MANAGER_EMAIL_RECIPIENT'),
];
ipstack is used to get info about ip-addresses - you can retrieve an access key here: https://ipstack.com/signup/free Results from ipstack are cached, so it won't drain the free lookups right away.
Pushover/slack/mail is used to inform about new og reopened incidents
Optionally, you can publish the views using
php artisan vendor:publish --tag="fejlvarp-views"
You can replace your exception-handler Replace
php artisan vendor:publish --tag=fejlvarp-provider
Remember to make sure that the service-provider is correctly installed.
You can have other applications report to the one you install it on, get inspiration from /src/Exceptions/LaravelFejlvarpExceptionHandler.php
$hash = config('app.name')
. $exception->getMessage()
. preg_replace('~revisions/[0-9]{14}/~', '--', $exception->getFile())
. $exception->getLine();
$isConsole = app()->runningInConsole();
$user = $isConsole ? null : request()->user();
$data = [
'hash' => md5($hash),
'subject' => $exception->getMessage() ? $exception->getMessage() : 'Subject is empty',
'data' => json_encode([
'application' => config('app.name'),
'error' => [
'type' => get_class($exception),
'message' => $exception->getMessage(),
'code' => $exception->getCode(),
'file' => $exception->getFile(),
'line' => $exception->getLine(),
'trace' => $exception->getTraceAsString(),
],
'environment' => [
'GET' => $_GET ?: null,
'POST' => $_POST ?: null,
'SERVER' => $_SERVER ?: null,
'SESSION' => (!$isConsole && request()->hasSession()) ? request()->session()->all() : null,
],
'application_data' => $user ? [
'user' => $user->toArray(),
] : null,
'queries' => app(Listener::class)->queries(),
], JSON_THROW_ON_ERROR),
];
$request = Request::create(
'/api/incidents',
'POST',
$data,
[],
[],
['CONTENT_TYPE'=>'application/x-www-form-urlencoded']
);
app()->handle($request);
When upgrading the package via Composer:
composer update tvup/laravel-fejlvarp
php artisan vendor:publish --tag="fejlvarp-assets" --force
runsMigrations() are detected by package discovery — new schema is applied next time php artisan migrate runs. No manual vendor:publish --tag="fejlvarp-migrations" needed unless you want a local copy to edit.php artisan vendor:publish --tag="fejlvarp-assets" --force after every package update so the published public/vendor/fejlvarp/app.css matches the new package version. Skipping this step leaves stale CSS in place — the dashboard still loads but may render incorrectly. (See #73 for a planned change that removes this step.)--force to take new package changes — but this overwrites your local edits. Diff first: php artisan vendor:publish --tag="fejlvarp-views" writes to resources/views/vendor/fejlvarp/.config/fejlvarp.php is never overwritten without --force. New config keys added in package updates won't appear until you re-publish manually or merge them in by hand.composer test
These instructions apply to your laravel application where laravel-fejlvarp is installed as a package
- '../local-fejlvarp-folder-relative-to-laravel-folder:/var/www/packages/laravel-fejlvarp'
(right below these lines)
volumes:
- '.:/var/www/html'
{
"type": "path",
"url": "../packages/laravel-fejlvarp",
"symlink": true
}
"tvup/laravel-fejlvarp": "@dev"
sail composer update tvup/laravel-fejlvarp
Now you don't need to run composer update each time you change something in the package. (Remember to set back yml- and composer-file before pushing anything)
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.