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

White Label Bundle Laravel Package

adespresso/white-label-bundle

Symfony2 bundle for shipping white-labeled versions of a website. Configure multiple “websites” selected by domain/host or user parameters, with priorities and custom params. Provides Twig helpers: whitelabel conditional blocks, website() info, and impersonateUrl().

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Symfony2 Legacy Constraint: The package targets Symfony2, while modern Laravel applications (v8+) or newer Symfony (v5+) may require compatibility adjustments. If the application is Symfony2-based, this could be a lightweight solution for white-labeling.
  • Laravel Integration Feasibility: Direct integration into Laravel is not feasible without significant refactoring (e.g., porting to a Laravel package or using a Symfony bridge). The bundle relies heavily on Symfony’s dependency injection, event system, and kernel architecture.
  • White-Label Use Case Fit: The core functionality (domain-based or user-param-based white-labeling) aligns with common multi-tenancy or branding needs, but Laravel has native alternatives (e.g., middleware, service providers, or packages like spatie/laravel-multitenancy).

Technical Risk

  • High Risk for Laravel Adoption:
    • Requires Symfony2 compatibility layer (e.g., symfony/console, symfony/http-kernel) or a rewrite.
    • Twig integration would need replacement with Laravel’s Blade or a Twig bridge.
  • Low Risk for Symfony2:
    • Minimal risk if the app is already Symfony2-based, but abandonware status (last release 2019) raises concerns about long-term support.
  • Configuration Complexity:
    • Hardcoded ae_white_label structure may not align with Laravel’s config/ or environment-based configurations.
  • Testing & Maintenance:
    • No active development or community support increases risk of undocumented bugs or breaking changes.

Key Questions

  1. Why Symfony2? Is the application legacy Symfony2, or is there a strategic reason to avoid Laravel-native solutions?
  2. Multi-Tenancy Scope: Are white-label needs limited to branding (CSS/JS) or do they require data isolation (e.g., separate databases)? This bundle only handles routing/branding.
  3. Alternatives Evaluated:
    • Has Laravel’s middleware (e.g., Route::domain()) or packages like spatie/laravel-multitenancy been considered?
  4. Twig Dependency: Is Twig already in use, or would Blade be preferred? If Blade, the Twig functions would need rewriting.
  5. Performance Impact: How would dynamic host/user-param routing scale compared to Laravel’s native routing?
  6. Future-Proofing: Is there a plan to migrate away from Symfony2, making this a temporary solution?

Integration Approach

Stack Fit

  • Symfony2: Direct fit with minimal setup (Composer + AppKernel registration). Configuration aligns with Symfony’s YAML/XML structure.
  • Laravel:
    • Option 1: Symfony Bridge: Use symfony/console and symfony/http-kernel as dependencies, but this is heavy and anti-pattern for Laravel.
    • Option 2: Rewrite as Laravel Package:
      • Port logic to Laravel’s service providers, middleware, and Blade directives.
      • Replace Twig functions with Blade components or custom helpers.
    • Option 3: Hybrid Approach:
      • Use the bundle only for routing logic (e.g., domain-based) and handle branding via Laravel’s asset pipelines or middleware.

Migration Path

Step Symfony2 Laravel (Rewritten)
1. Installation composer require adespresso/white-label-bundle composer require vendor/laravel-white-label (custom)
2. Registration AppKernel::registerBundles() config/app.php (service provider)
3. Configuration YAML/XML in config.yml config/whitelabel.php (Laravel-style)
4. Routing Bundle handles domain/user-param routing Laravel middleware or Route::domain()
5. Templating Twig functions (whitelabel, website) Blade directives or custom helpers
6. Testing Symfony’s test tools Laravel’s PHPUnit/Pest

Compatibility

  • Symfony2:
    • High: Designed for Symfony2’s ecosystem (e.g., ContainerAware, EventDispatcher).
    • Low: May conflict with Symfony3/4/5+ due to deprecated APIs.
  • Laravel:
    • Low: Requires significant abstraction (e.g., replacing ContainerInterface with Laravel’s Container).
    • Partial: Routing logic (domain/user-param) could be adapted, but templating and DI would need overhauls.

Sequencing

  1. Assess Scope:
    • Confirm if white-labeling is only branding (CSS/JS) or includes routing/data isolation.
  2. Symfony2 Path:
    • Install bundle, configure ae_white_label, test Twig functions.
    • Extend with custom logic if needed (e.g., event listeners).
  3. Laravel Path:
    • Phase 1: Implement routing via middleware (e.g., WhitelabelMiddleware).
    • Phase 2: Replace Twig with Blade (e.g., @whitelabel directive).
    • Phase 3: Abstract configuration to Laravel’s config/ system.
  4. Fallback:
    • Use Laravel-native solutions (e.g., spatie/laravel-multitenancy for tenancy, middleware for branding) if rewrite is too costly.

Operational Impact

Maintenance

  • Symfony2:
    • Pros: Minimal maintenance if the app is already Symfony2.
    • Cons: No updates since 2019; security risks if underlying Symfony2 dependencies are outdated.
  • Laravel (Rewritten):
    • Pros: Aligns with Laravel’s ecosystem (e.g., dependency injection, testing).
    • Cons: High initial effort; requires ongoing maintenance for feature parity.
  • Shared:
    • Documentation: README is minimal; expect to write internal docs for configuration/usage.
    • Debugging: Limited community support increases time to resolve issues.

Support

  • Symfony2:
    • Limited: No active maintainer; rely on Symfony2 forums or reverse-engineering.
  • Laravel:
    • Better: Can leverage Laravel’s community, but custom package may lack adoption.
  • Workarounds:
    • For critical issues, consider forking the repo and maintaining it internally.

Scaling

  • Routing Overhead:
    • Domain/user-param checks add minimal latency (Symfony2/Laravel both handle this efficiently).
  • Configuration Scaling:
    • Symfony2’s YAML/XML may become cumbersome for 100+ white-labels; consider a database-backed solution (e.g., whitelabels table).
  • Caching:
    • Laravel’s route caching (php artisan route:cache) would help, but Symfony2 may need manual OPcache tuning.

Failure Modes

Risk Symfony2 Laravel (Rewritten)
Bundle Breakage High (abandonware) Medium (depends on rewrite quality)
Configuration Errors High (YAML/XML) Low (Laravel’s config/ is more intuitive)
Routing Conflicts Medium (Symfony’s router) Low (Laravel’s router is more flexible)
Templating Issues High (Twig dependency) Medium (Blade alternative needed)
Dependency Vulnerabilities High (outdated Symfony2) Low (modern Laravel dependencies)

Ramp-Up

  • Symfony2:
    • Time: 1–3 days for basic setup; longer for edge cases.
    • Skills: Requires Symfony2 DI, Twig, and kernel knowledge.
  • Laravel:
    • Time: 2–4 weeks for full rewrite (depends on team velocity).
    • Skills: Laravel middleware, service providers, Blade, and testing.
  • Training:
    • Symfony2: Team may need refresher on Symfony2-specific patterns.
    • Laravel: Documentation can be leveraged, but custom logic requires internal knowledge sharing.
  • Onboarding:
    • Symfony2: Steeper if team is Laravel-focused.
    • Laravel: Easier if team is already familiar with Laravel’s ecosystem.
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.
daikazu/eloquent-salesforce-objects
unseen-codes/chat
romalytar/yammi-jobs-monitoring-laravel
kisame76/filament-db-table-state
nqxcode/laravel-lucene-search
dpfx/laravel-livewire-wizards
workos/workos-php-laravel
sofa/laravel-global-scope
nawasara/auth-primitives
adhocrat-io/arkhe-main
make-dev/orca-harpoon
itsemon245/lamet
baks-dev/dashboard
amoifr/pickle-panther-bundle
make-dev/orca
dmstr/symfony-system-resources-bundle
dmstr/symfony-job-queue-bundle
dmstr/openapi-json-schema-bundle
dmstr/keycloak-security-bundle
dmstr/doctrine-audit-log-bundle