locastic/loggastic
Loggastic is a Laravel package for logging user activity and model changes. It records who did what and when, helping you build audit trails and simplify debugging. Lightweight and easy to drop into existing Laravel applications.
Architecture fit
storage: elasticsearch | doctrine | in_memory. When the backend is not Elasticsearch, no ES services are registered at all — no client, no elastic_* config, no PSR-18 requirement. That removes the single heaviest piece of infrastructure coupling in the original assessment.doctrine backend is genuinely portable in a way the ES backend was not. It targets DBAL 3.8+ and 4.x, runs on PostgreSQL/MySQL/SQLite, uses JSON columns with an indexed discriminator column, normalizes timestamps to UTC, and makes tracker writes upserts. That is a sane schema and it is the part worth reusing.in_memory) ship in the box.Integration feasibility
DB/query builder or Eloquent, ship Laravel migrations that mirror the DBAL-created schema. Avoids Doctrine DBAL entirely if we translate the small adapter.in_memory gives a working reference for sort/pagination/per-class isolation semantics), and the productionization window compresses from one-to-two weeks toward roughly one week, assuming we write our own migrations rather than adopting DBAL's schema API.doctrine/dbal into the container graph. The new explicit doctrine/dbal (^3.8 || ^4.0) dependency is a second DB abstraction layer sitting beside Eloquent — a cognitive and maintenance tax we should not pay for a logging concern.Technical risk
doctrine/dbal is now a hard dependency. For a Laravel app this is not free — Laravel dropped its DBAL requirement for column modification, so we would be reintroducing it solely to satisfy a logging library's adapter.php artisan migrate to be the source of truth. Reconciling two schema-management mechanisms is a real integration hazard and the most likely source of friction in a direct-adoption scenario.elasticsearch, upgrade from 2.0.0 is a plain composer update. This is relevant only if we had already adopted 2.0.0, which we have not; treat it as a signal of release discipline, not as a migration task for us.Key questions
in_memory backend cover the same code path as the real backends (i.e., can it serve as a contract-test fixture), or is it a simplified stub?Stack fit
in_memory gives us something the prior version lacked: a zero-dependency test backend that lets us assert on sorting, pagination, and per-class isolation in our own test suite.Migration path
Loggastic-style facade, an Eloquent/query-builder driver, and the in_memory driver as a test double.spatie/laravel-activitylog plus a custom storage driver if we prefer a supported Laravel-native base — now a closer call than before, since the DB-backed target state is similar and the third-party surface we avoid is larger.Compatibility
doctrine/dbal constraint conflict surface with the rest of the estate.Sequencing
in_memory test double → domain rollout. Can run in parallel with other application work; it no longer needs to be isolated.Maintenance
doctrine/dbal dependency is avoided entirely on the extraction path; on a direct-adoption path we would be tracking both Symfony and DBAL majors. Another point for extraction.Support
Scaling
Failure modes
Ramp-up
How can I help you explore Laravel packages today?