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
Parameter Bundle

Parameter Bundle Laravel Package

ardent/parameter-bundle

View on GitHub
Deep Wiki
Context7

Simple bundle for storing parameters in a database

Frequently asked questions about Parameter Bundle
How do I install ArdentParameterBundle in a Laravel project?
Since the bundle is Symfony-based, you’ll need to manually install it via Composer (`composer require ardent/parameter-bundle`) and create a Laravel service provider to bridge Symfony’s dependency injection. Avoid using Symfony’s autowiring; instead, bind the bundle’s services to Laravel’s container manually in `AppServiceProvider`.
Does ArdentParameterBundle work with Laravel’s Eloquent ORM?
No, the bundle relies on Doctrine ORM. For a Laravel project, you’ll need to either use Doctrine alongside Eloquent or create a custom repository layer that translates Doctrine queries to Eloquent. The bundle’s `Parameter` entity can be mapped to an Eloquent model, but some Doctrine-specific features (like event listeners) may require adjustments.
Can I use this bundle for feature flags in Laravel?
Yes, but you’ll need to extend the bundle to support feature flag logic (e.g., boolean values, user targeting). The bundle stores key-value pairs, so you can model feature flags as parameters like `feature.new_dashboard.enabled=true`. For performance, cache frequently accessed flags using Laravel’s cache driver or Redis.
What Laravel versions does ArdentParameterBundle support?
The bundle itself is Symfony-focused, but you can adapt it for Laravel 8.x–10.x. The main compatibility hurdle is Symfony’s dependency injection; Laravel’s container can replace it with manual bindings. Test thoroughly, as some Symfony components (like EventDispatcher) may not integrate seamlessly without wrappers.
How do I migrate existing .env or config parameters to the database?
Create a Laravel migration to add a `parameters` table matching the bundle’s schema, then write a seeder or artisan command to import values from `.env` or `config/`. Use a tool like `laravel/env-to-database` or a custom script to parse and migrate these values. Ensure you handle type casting (e.g., strings vs. booleans) explicitly.
Will this bundle slow down my Laravel app if I store many parameters?
Database-backed parameters introduce latency, especially for high-read scenarios. Mitigate this by caching parameters in Redis or Laravel’s cache driver. For write-heavy use cases (e.g., real-time feature toggles), consider denormalizing parameters into a dedicated cache table or using a pub/sub system to invalidate cache on updates.
Can I add validation rules for parameters before saving?
The bundle doesn’t include built-in validation, but you can extend it by overriding the `Parameter` entity or adding a custom service. Use Laravel’s validator facade or Symfony’s validator component (if bridged) to enforce rules like regex patterns, numeric ranges, or JSON schema validation. Hook into the bundle’s event system or create a middleware layer for pre-save checks.
How do I audit or log changes to parameters in Laravel?
Extend the bundle’s `Parameter` entity to include timestamps for changes or use Laravel’s logging (Monolog) to track modifications. Create a custom observer or listener to log parameter updates to a separate `parameter_audit` table. Integrate with Laravel’s logging channels to centralize logs or use packages like `spatie/laravel-activitylog` for structured auditing.
Are there alternatives to ArdentParameterBundle for Laravel?
Yes, consider native Laravel solutions like `spatie/laravel-config-array` for config-like parameters or `spatie/laravel-feature-flags` for feature toggles. For database-backed params, `beberlei/doctrineextensions` (with custom entities) or a lightweight Eloquent-based solution (e.g., `laravel-parameters`) may be simpler. Evaluate based on your need for Symfony integration or Doctrine ORM.
How do I handle concurrent updates to parameters in production?
The bundle doesn’t include built-in concurrency controls, so you’ll need to implement them manually. Use database-level locking (e.g., `SELECT ... FOR UPDATE` in PostgreSQL) for critical parameters or optimistic locking with a `version` column in the `parameters` table. For high-contention scenarios, consider a distributed lock manager like Redis or a queue-based update system.
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.
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table
siberfx/flysystem-wasabi
hollyit/token-replace
ippanelcom/laravel-sdk
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel