talleu/trigger-mapping
Trigger Mapping is a Laravel package for defining and managing database trigger mappings with a clean, fluent API. It helps you connect database events to application logic, keeping trigger definitions organized, readable, and maintainable.
Framing correction up front: despite the "Laravel/PHP package" brief, talleu/trigger-mapping is a Symfony bundle built around Doctrine. Every integration estimate below assumes that mismatch is the dominant technical fact, not a footnote.
Architecture fit
DependencyInjection/*Extension and Bundle classes that Laravel never loads.Integration feasibility
CREATE TRIGGER ... FOR EACH ROW, PostgreSQL trigger functions, SQLite's limited support, SQL Server's different syntax entirely). Supported platforms are the first thing to verify, not the last.Technical risk
doctrine:schema:update --force or a naive migration can leave triggers orphaned or duplicated. Unless the package ships a diff/idempotency layer, you get drift.CREATE TRIGGER, deploys fail on second run.doctrine:migrations:rollback. Disaster recovery becomes "re-run the sync command against the restored DB," which must be documented and rehearsed.Platform introspection methods; Symfony 7 tightened service definitions. A 93-star, single-maintainer bundle is unlikely to have a wide CI matrix.Key questions
--dry-run/diff mode usable in CI to detect drift?TRIGGER, SUPER on some MySQL configurations, ownership on Postgres)?Stack fit
doctrine:schema:update in production should stop and fix that first — this package assumes migrations are the only schema authority.Migration path
information_schema.TRIGGERS on MySQL, pg_trigger on Postgres). Most teams are surprised by what is already there.Compatibility Build an explicit matrix and pin it: PHP minor version × Symfony LTS × Doctrine DBAL major × DB engine and version × package tag. Re-verify on every DBAL major bump, since that is where the introspection breakage lives. Also confirm the bundle's console command name and whether it collides with existing Doctrine commands.
Sequencing
Maintenance
^ ranges on a package this small.Support
Scaling
INSERT/UPDATE on a mapped table pays the cost. Row-by-row trigger logic is a classic write-throughput trap; validate under realistic load before attaching triggers to hot tables.Failure modes
schema:update drops or ignores triggers; app logic quietly stops firing. Detect via the CI drift check.COMMENT on each trigger pointing at the owning class.TRIGGER.Ramp-up
How can I help you explore Laravel packages today?