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

Database Activator Laravel Package

flagception/database-activator

Doctrine DBAL-backed activator for Flagception feature flags. Stores flag state in a SQL database (MySQL/Postgres/SQLite), auto-creates the table, and supports connection arrays, DSNs, or an existing DBAL instance, with customizable table/column names.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Feature Flag Centralization: Enables a single source of truth for feature flags across all environments (dev, staging, production), eliminating configuration drift and manual errors. Critical for teams scaling Laravel applications with microservices or multi-region deployments.
  • Dynamic Feature Rollouts: Supports gradual rollouts, A/B testing, and canary releases by integrating with Flagception’s SDK, reducing risk for high-impact changes (e.g., new payment flows, UI experiments).
  • Decoupled Feature Management: Allows non-engineers (e.g., product managers) to toggle flags via admin panels (e.g., Laravel Nova, Filament) without redeploying code, accelerating iteration.
  • Auditability and Compliance: Provides a persistent log of flag changes (when combined with custom schema extensions), useful for regulatory compliance (e.g., GDPR) or post-mortems.
  • Cost-Effective Scalability: Avoids vendor lock-in with proprietary feature flag services (e.g., LaunchDarkly, Flagsmith) while offering database-level performance and customization at a fraction of the cost.
  • Roadmap Validation: Justifies investment in feature flag infrastructure before adopting more complex tools, aligning with Laravel’s ecosystem and PHP’s long-term support (e.g., PHP 8.3+).
  • Build vs. Buy: Eliminates the need to build a custom database-backed flag system, saving 3–6 months of dev time while leveraging a battle-tested (Flagception) and lightweight solution.

When to Consider This Package

Adopt When:

  • You’re using Flagception SDK and need database persistence for feature flags (not just environment variables, Redis, or files).
  • Your application is distributed (e.g., microservices, serverless, or scaled Laravel Forge/Vapor deployments) and requires cross-instance consistency.
  • You need multi-environment support (e.g., toggling flags differently in staging vs. production) without manual configuration.
  • Your team prefers open-source, PHP-native solutions over SaaS tools, with the flexibility to extend or replace components later.
  • You’re running PHP 7.4+ and can upgrade to DBAL 3.5+ (or are already on Laravel 8+).
  • You want to reduce deployment risk by enabling dynamic toggles for critical features (e.g., new APIs, UI changes).
  • You plan to build an admin interface (e.g., Laravel Nova, Filament) for flag management and need a simple, queryable data layer.

Look Elsewhere If:

  • You’re not using Flagception: This package is tightly coupled to Flagception’s SDK. Alternatives:
    • Spatie’s Laravel Feature Flags (for Laravel-specific solutions).
    • Commercial tools (LaunchDarkly, Flagsmith) if you need real-time updates, advanced targeting, or analytics.
  • You need real-time flag updates: This package uses polling (database reads) for flag evaluation. For WebSocket-based updates, consider:
    • Flagsmith (PHP client available).
    • Custom WebSocket + Redis layer.
  • You require multi-tenancy or row-level security: The package is single-tenant by design; extend with tenant_id columns or database views.
  • Your team lacks PHP/Laravel expertise or prefers a no-code UI (e.g., Unleash, Optimizely).
  • You’re constrained by legacy PHP versions (<7.4) or unsupported databases (e.g., Oracle, non-standard SQL dialects).
  • You need flag analytics (e.g., usage metrics, impact analysis) or integrated experimentation (e.g., Google Optimize).

How to Pitch It (Stakeholders)

For Executives:

*"This package lets us store feature flags in our existing database—MySQL, PostgreSQL, or SQLite—so we can toggle features dynamically without redeploying code. It’s a low-cost, high-impact solution that:

  • Reduces risk: Enable gradual rollouts for critical features (e.g., new checkout flows) and kill switches for emergencies.
  • Saves time: Product managers can toggle flags via a simple admin panel (e.g., Laravel Nova), cutting deployment cycles by 30–50%.
  • Scales effortlessly: Works across all our Laravel services and environments, with no vendor lock-in.
  • Future-proofs our stack: Integrates with our existing PHP/Laravel ecosystem and can grow with our needs (e.g., adding analytics later).

Cost: Free (MIT license). Risk: Minimal—we’re just adding a lightweight database layer. ROI: Faster iterations, fewer bugs, and happier customers."*


For Engineering:

*"flagception/database-activator lets us persist feature flags in a database using DBAL, so flags sync across all instances. Here’s why it’s a smart choice:

  • Zero setup: Auto-creates the flagception_features table (or custom schema) with no migrations needed.
  • Flexible: Supports DSN strings, array configs, or pre-initialized DBAL instances, fitting our CI/CD and production setups.
  • Lightweight: Adds ~500 lines of code (vs. building a custom solution) and no external dependencies beyond Flagception and DBAL.
  • Extensible: We can later add:
    • Audit logs (custom columns like updated_at, user_id).
    • Caching (Redis layer for frequent flags).
    • Admin UI (Laravel Nova/Filament integration).

Tradeoffs:

  • We’re tied to Flagception’s evaluation logic (but this gives us persistence for pennies).
  • No real-time updates (flags update on DB read; for WebSockets, we’d need a separate layer).
  • PostgreSQL quirks are mitigated by parametrized queries (fixed in v1.1.1).

Next steps:

  1. Pilot: Replace in-memory flags for non-critical features first.
  2. Monitor: Track DB performance under load (e.g., EXPLAIN ANALYZE on flag queries).
  3. Extend: Add custom columns (e.g., description, environment) via migrations.

Alternatives considered:

  • Spatie’s Laravel Feature Flags: More Laravel-specific but lacks Flagception’s advanced targeting.
  • LaunchDarkly: Overkill for our needs (SaaS dependency, cost at scale).
  • Custom solution: Would take 2–3 sprints to build; this does it in 1 day."*

For Product Managers:

*"This tool lets us control features with a flip of a switch—no more waiting for engineers to deploy. Here’s how it helps you:

  • Faster experiments: Toggle A/B tests (e.g., new homepage design) without dev cycles.
  • Safe launches: Roll out features to 10% of users first, then scale up based on data.
  • Emergency kills: Disable buggy features instantly (e.g., if a new API breaks).
  • No more config files: Flags are stored in the database, so they’re consistent across all environments.

How it works:

  1. Engineers set up the database layer (one-time task).
  2. You get a simple UI (we’ll build one with Laravel Nova) to toggle flags.
  3. Flags update immediately for all users (or a subset, if configured).

Example:

  • Before: To change a feature, you’d email engineering → wait for a deploy → test in staging.
  • After: You toggle a flag in the admin panel → changes live in seconds.

Cost: Zero. Risk: None—we’re just adding a database table. Impact: Big for velocity and reliability."*

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.
besmartand-pro/php-quality-config
sentix/ai-chatbot
terminal42/code-quality-tools
codifyo/ts-generator-bundle
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