Weave 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
Simple Behaviors Bundle

Simple Behaviors Bundle Laravel Package

rmed19/simple-behaviors-bundle

A lightweight Symfony bundle that adds reusable Doctrine behaviors to your entities—timestamps, blameable users, and slugs—through simple traits and minimal configuration, so common entity logic stays consistent and boilerplate-free.

View on GitHub
Deep Wiki
Context7

At a glance

Frequently asked questions about Simple Behaviors Bundle
What is rmed19/simple-behaviors-bundle used for?
It is a lightweight Symfony bundle that packages common Doctrine entity behaviors as reusable traits and services. Instead of copying timestamp, blameable-user, or slug logic into every model, you apply the provided traits so the shared functionality lives in one place. The goal is smaller, more consistent entity code across a project.
How do I install rmed19/simple-behaviors-bundle with Composer?
Run composer require rmed19/simple-behaviors-bundle in the root of your Symfony project. Because it is a Symfony bundle built around Doctrine entities, the project should already have Symfony and doctrine/orm installed. After installation, make sure the bundle is registered and its services are loaded in the environments where you persist entities.
How do I register and configure the bundle in Symfony?
Add the bundle to the array in config/bundles.php, or let Symfony Flex handle registration if a recipe is available. Any optional settings belong in a YAML file under config/packages, where you can adjust behavior options such as the property used to store the blameable user. Check the repository README for the exact bundle class name and supported configuration keys before deploying.
Which entity behaviors does the bundle provide?
The bundle focuses on the classic cross-cutting behaviors: timestamps, blameable users, and slugs. Timestamps track created and updated dates, blameable records which user created or changed a record, and slug behavior generates URL-friendly identifiers from a source field. The precise trait names and options are documented in the repository, so confirm them against the version you install.
Do the traits populate timestamps and blameable users automatically?
The traits mainly add properties plus getters and setters, while the bundle registers Doctrine listeners or subscribers as services that fill values on prePersist and preUpdate. That means the automatic behavior only works when the bundle's services are active in the current environment. Verify this for console commands, queue workers, and test kernels, not just web requests.
Does rmed19/simple-behaviors-bundle work with Laravel?
No. This is a Symfony bundle designed for Doctrine entities, so it will not integrate with Laravel's Eloquent models or service container. Laravel projects should use Laravel-specific packages for timestamps, slugs, and blameable-style tracking. For Symfony applications using Doctrine ORM, the bundle fits naturally.
Can I extend the bundle with my own custom behaviors?
Yes, the bundle is described as easy to extend with custom behaviors. Follow the same pattern it uses: a trait that adds fields and accessors, plus any supporting service or listener for the automatic logic. Keeping your own behaviors in that style helps entities stay consistent as the project grows.
What are the alternatives to rmed19/simple-behaviors-bundle?
The best-known option is gedmo/doctrine-extensions, which provides timestampable, blameable, and sluggable listeners for Doctrine. Some teams prefer writing small custom traits and listeners in-house when they only need one or two behaviors. This bundle is a good fit if you want a minimal Symfony-native package without a large extension suite.
Is the bundle maintained and compatible with recent Symfony and Doctrine versions?
Check Packagist and the GitHub repository for recent commits, releases, and the version constraints in composer.json before adopting it. Those constraints tell you which Symfony and doctrine/orm versions are supported. For production, pin a specific version and review changes before upgrading Symfony or Doctrine.
How do I test entities that use these behaviors?
For pure trait logic, instantiate the entity in a unit test and assert that setters, getters, and slug generation behave as expected. To exercise the Doctrine listeners, use an integration test with an in-memory SQLite database or a KernelTestCase that boots the bundle's services. Mock or stub the user/token storage so blameable values can be asserted without a real authenticated request.
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.
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle