Reading the repo
Reading the repo
How to install on Windows
Filament tracer is a flexible filament plugin to report and view exceptions and traces with a generic table schema to be able to store traces from other programming languages.
Saved setup from 10 h ago
Will it work on my device?
Then run powershell -ExecutionPolicy Bypass -File .\setup.ps1. It stops at the first error and is safe to run again. Servers and tests aren't started; it lists them at the end. Read it first.
Needs Git: winget install Git.Git
git clone https://github.com/Entensy/filament-tracer.git cd filament-tracer
Node.js LTS (no version pinned), PHP ^8.2|^8.3|^8.4
winget install CoreyButler.NVMforWindows nvm install lts nvm use lts scoop install php composer # needs scoop: https://scoop.sh
corepack enable pnpm install composer install
pnpm dev
Register the plugin in your desired filament panel:
public function panel(Panel $panel): Panel
{
return $panel
...
->plugins([
FilamentTracerPlugin::make()
// You may define how you would like to get tab badge numbers, these must return int type
->tracesCounterUsing(fn($record) => count( explode(PHP_EOL, $record->traces) ) ?? 0)
->queriesCounterUsing(fn($record) => /** return int value */)
->bodyCounterUsing(fn($record) => /** return int value */)
->headersCounterUsing(fn($record) => /** return int value */)
->cookiesCounterUsing(fn($record) => /** return int value */)
]);
}
To register capturing exceptions and errors, go to your
app\Exceptions\Handler.php file and put the following snippet into register
method:
$this->reportable(function (Throwable $e) {
if ($this->shouldReport($e)) {
\Entensy\FilamentTracer\FilamentTracer::capture($e, request());
}
});
You may change the palette colors in your Filament Panel Service Provider:
$panel
->colors([
'danger' => Color::Rose,
'primary' => Color::Red,
'success' => Color::Green,
'warning' => Color::Yellow,
'gray' => Color::Gray,
'info' => Color::Blue,
])
You may publish configuration using Laravel's publish command:
# Publish config file
php artisan vendor:publish --tag=filament-tracer-config
# Publish views
php artisan vendor:publish --tag=filament-tracer-views
# Publish translations
php artisan vendor:publish --tag=filament-tracer-translations
# Publish migrations
php artisan vendor:publish --tag=filament-tracer-migrations
You may write your own tracer class by changing the default class in the plugin
config file. If you don't have this file, you may publish it with
php artisan vendor:publish --tag=filament-tracer-config file:
[
...
// You may implement your own tracer by implementing Tracerable interface
'tracer' => \Entensy\FilamentTracer\DefaultTracer::class,
...
]
Defining a custom Tracer class has to implement Tracerable interface.
use Entensy\FilamentTracer\Contracts\Tracerable;
class MyCustomTracer implements Tracerable
{
//
}
If you would like to change how an error being stored, you may overwrite this
implementation by implementing HasStore interface in your custom tracer class
then add your implementation in store method
use Entensy\FilamentTracer\Contracts\HasStore;
use Entensy\FilamentTracer\Contracts\Tracerable;
class MyCustomTracer implements Tracerable, HasStore
{
public function store(): mixed
{
$err = $this->getThrowable():
// just log the trace and don't store it in database
logger()->error($err);
return true;
}
}
composer test
Please see CHANGELOG for more information what has changed recently.
No reports for Windows yet.
Opens a chat with this manual already filled in, for Windows. It uses your own account; gitmanual sends nothing.