tomatophp/tomato-logs-module
A Laravel module that adds a log viewer to the Tomato PHP admin panel, letting you browse, filter, and inspect application log files from a clean interface instead of digging through server files.
This is the initial v1.0.0 tag of tomatophp/tomato-logs-module, a module in the TomatoPHP admin ecosystem (Filament-based panels). The release notes are only a changelog link, so treat the README and src/ as the source of truth on first install.
Minimal path to a working screen:
composer require tomatophp/tomato-logs-module
vendor/tomatophp/tomato-logs-module/composer.json and confirm the filament/filament, laravel/framework, and tomatophp/tomato-admin (or equivalent core) version ranges match what you already run. Filament v2 vs v3 mismatches are the most common install failure in this ecosystem.php artisan vendor:publish
then publish the config and migrations under the tomato-logs tag(s) shown.php artisan migrate
php artisan optimize:clear
*Plugin.php class implementing Filament's Plugin contract in src/). Add it to your panel provider's ->plugin(...) chain, or to the Tomato module registry, depending on which pattern the README documents.Where to look first: README.md → src/ (service provider + any Filament Resources/) → config/ → database/migrations/. The migration tells you what is actually being stored (log rows vs. file references vs. activity entries), which determines every downstream decision.
First real use case: give support/ops staff a read-only "Logs" screen in the admin panel so they can filter recent errors by level and date instead of SSHing in to tail -f storage/logs/laravel.log. Wire it up, confirm entries appear by triggering a known exception or failed job, then decide on retention before it accumulates data.
Verify what "logs" means here before building on it. Tomato modules vary: some wrap spatie/laravel-activitylog (audit trail of model changes), some read Monolog/storage/logs files, some add a DB-backed Monolog handler. Read the migration and the service provider — if there's a ->pushHandler(...) or a custom channel, the module is capturing writes; if it only reads a path from config, it's a viewer over existing files. Your integration strategy differs a lot between those two.
If it's a DB-backed handler:
config/logging.php as a stack member so you keep the file channel as a fallback:
'stack' => [
'driver' => 'stack',
'channels' => ['single', 'tomato-logs'],
],
model:prune on the module's model (if it uses MassPrunable) or a small scheduled delete keeps the table honest. Check config/tomato-logs.php for a retention key before writing your own.If it's a file viewer:
storage_path('logs/laravel.log')), not a hardcoded relative path — path resolution differs between php artisan serve, queue workers, and Octane.laravel-2024-01-01.log) are within the configured directory, and confirm the reader handles them, or your history disappears at the daily rotate.Panel integration:
canViewAny check keyed to a permission (Tomato typically pairs with spatie/laravel-permission + Shield). Logs contain stack traces, queries, and sometimes credentials in payloads — this should not be visible to every panel user.Day-to-day workflow tips:
storage/logs for full context — panel viewers usually truncate long messages.LOG_LEVEL per environment so local/staging capture debug into the panel while production stays at error, otherwise the table becomes noise.v1.0.0 is a first tag. There is no track record, no deprecation history, and the public API (config keys, resource class names, table schema) may shift in 1.0.x or 1.1. Pin with "tomatophp/tomato-logs-module": "1.0.*" in composer.json and read the diff before bumping.config/ and database/migrations/ between tags manually — that's where breakage hides in this ecosystem.php artisan optimize:clear, then php artisan filament:optimize-clear if you've run filament:optimize. Auto-discovery caches bite here regularly.storage/logs may be empty or wiped on each deploy — a file-based viewer will look broken in production while working locally. Either persist the volume or use the DB-backed mode.php artisan filament:assets (or vendor:publish --tag=filament-assets) for any bundled views/CSS; a broken-looking page is usually missing assets, not a broken package.Log models, or view overrides registered there survive package upgrades better than editing files in vendor/. If you need custom columns or parsing, extend the resource class in your own app/Filament namespace rather than patching the vendor copy.How can I help you explore Laravel packages today?