Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Doctrine Footprint Extension Laravel Package

adrianglazer/doctrine-footprint-extension

Doctrine extension to auto-track entity create/update/delete with timestamps and usernames. Adds created_at/by, updated_at/by, deleted_at/by via a single trait + event subscriber, plus a Doctrine filter for soft deletes.

View on GitHub
Deep Wiki
Context7

DoctrineFootprintExtension

This extension provides timestamps and user actions tracking for entity create, update and delete.

By using only one trait and listener you can automate update of created_at, created_by, updated_at, updated_by, deleted_at, deleted_by.

Listener will automatically set date times and also usernames into each entity which contains mentioned fields.

Installation

composer require adrianglazer/DoctrineFootprintExtension

Setup

By default all functionalities are enabled together with soft deletable. If you would like to disable soft deletable you will have to create your own Trait without deletedAt and deletedBy fields.

You have to set a doctrine filter config inside config/packages/doctrine.yaml:

doctrine:
    dbal:
        ...
    orm:
        ...
        mappings:
            ...
        filters:
            footprint:
                class: Glazer\DoctrineFootprintExtension\Filter\FootprintFilter
                enabled: true

and set a listener inside config/services.yaml:

    Glazer\DoctrineFootprintExtension\Listener\FootprintListener:
        class: Glazer\DoctrineFootprintExtension\Listener\FootprintListener
        autowire: true
        tags:
            - { name: doctrine.event_subscriber }
        arguments: ['@security.token_storage']

Conclusion

If you set everything correctly your entities will start to update automatically on each user action. It's an out of the box solution designed for simple projects.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
calmfox/watch-sylius
damienfern/grpc-symfony-bundle
atoolo/index-bundle
atoolo/genai-bundle
coprotoai/laravel-ticket
davidjln/llm-carbon-bundle
cryonighter/valid-request-bundle
coolms/taxonomy-bundle
coolms/field-bundle
articulate-orm/symfony
aaix/laravel-tall-architect
ephoto/akeneo-connector
emmanuelballery/eb-plantumlbundle
emielburgman/symfony-visitor-beacon
emielburgman/symfony-visit-storage
emielburgman/symfony-security-headers
emielburgman/symfony-log-viewer
emarref/xdebug-bundle
emarref/pubnub-bundle
elriseio/finance-money-bundle