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.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor