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

Easy Redirect Bundle Laravel Package

agence-adeliom/easy-redirect-bundle

Symfony bundle to manage URL redirects and log 404 errors. Intercepts 404s, looks up matching redirects, performs redirects, and updates hit count/last accessed. Stores 404 path/URL/timestamp/referer for stats and clears matching 404s when redirects change.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Symfony/EasyAdmin Alignment: The package is tightly coupled with EasyAdmin, making it ideal for projects leveraging this admin panel. If the project already uses EasyAdmin (v3.4+ or v4.0+), this bundle integrates seamlessly into the existing dashboard workflow.
  • Modularity: The bundle introduces two core entities (Redirect and NotFound) with clear separation of concerns, fitting well into a Symfony-based architecture where database-driven redirects are needed.
  • Symfony Ecosystem Compatibility: Works natively with Symfony’s DI container, Doctrine ORM, and Flex recipes, reducing friction in adoption.

Integration Feasibility

  • Low-Coupling Design: The bundle does not impose invasive changes to existing codebases. It primarily extends EasyAdmin’s dashboard and adds database tables for redirects/404s.
  • Configuration-Driven: Key behaviors (e.g., remove_not_founds) are configurable via YAML, allowing granular control over functionality.
  • Dependency Constraints: Requires EasyAdmin (v3.4+/v4.0) and Symfony 5.4+/6.x, which may limit adoption in legacy projects but aligns with modern Symfony stacks.

Technical Risk

  • EasyAdmin Dependency: Projects not using EasyAdmin will need to either:
    • Adopt EasyAdmin (higher effort) or
    • Fork/modify the bundle to work with alternative admin panels (e.g., SonataAdmin), introducing maintenance overhead.
  • Database Schema Changes: Adds two new tables (redirect and not_found), requiring migrations. Potential conflicts if the project already uses similar tables (e.g., custom redirect systems).
  • Performance Implications:
    • 404 logging could impact performance under high traffic if not optimized (e.g., batch inserts, indexing).
    • Redirect lookups are path-based; ensure the path column is indexed in the redirect table.
  • Symfony Version Lock-In: Tied to specific Symfony/EasyAdmin versions. Upgrading these dependencies may require bundle updates.

Key Questions

  1. Does the project use EasyAdmin?
    • If not, is adopting it feasible, or would a custom solution (e.g., standalone redirect CRUD) be preferable?
  2. Are there existing redirect/404 handling mechanisms?
    • Overlap with this bundle could cause conflicts or require refactoring.
  3. What are the traffic/performance expectations for 404 logging?
    • High-volume sites may need to optimize logging (e.g., async writes, retention policies).
  4. How critical is real-time 404 cleanup?
    • The remove_not_founds feature deletes matched 404s on redirect updates. Test this behavior in staging to avoid data loss.
  5. Is the MIT license acceptable?
    • Verify compatibility with the project’s existing licensing (e.g., proprietary components).

Integration Approach

Stack Fit

  • Primary Use Case: Symfony projects using EasyAdmin for admin interfaces, needing a database-backed redirect system with 404 tracking.
  • Alternatives Considered:
    • ZenstruckRedirectBundle: More feature-rich (e.g., HTTP cache support) but lacks EasyAdmin integration.
    • Custom Solution: Higher initial effort but offers flexibility for non-EasyAdmin projects.
  • Stack Requirements:
    • Symfony 5.4+/6.x (for bundle compatibility).
    • Doctrine ORM (for entity management).
    • EasyAdmin 3.4+/4.0 (for dashboard integration).

Migration Path

  1. Pre-Integration:
    • Audit existing redirect/404 handling (e.g., .htaccess, custom controllers).
    • Backup existing redirect rules if migrating from another system.
  2. Installation:
    • Add the bundle via Composer (composer require agence-adeliom/easy-redirect-bundle).
    • Update config/packages/easy_redirect.yaml with entity classes and model manager.
    • Run migrations (doctrine:migration:diff + migrate).
  3. Dashboard Integration:
    • Extend DashboardController with EasyRedirectTrait and update configureMenuItems().
    • Customize the redirect form type if additional fields are needed.
  4. Testing:
    • Verify redirects work via the admin panel.
    • Test 404 logging by accessing non-existent routes and checking the not_found table.
    • Confirm remove_not_founds behavior (e.g., creating a redirect should delete matching 404s).

Compatibility

  • Symfony/EasyAdmin: Direct compatibility with supported versions (see table in README).
  • Customization:
    • Override entity classes (redirect_class, not_found_class) for extended functionality.
    • Extend the RedirectType form to add custom fields.
  • Conflict Risks:
    • Naming collisions with existing Doctrine entities (e.g., Redirect class).
    • Route conflicts if the project uses path-based redirects in controllers.

Sequencing

  1. Phase 1: Core Integration
    • Install bundle, configure, and set up migrations.
    • Integrate with EasyAdmin dashboard.
  2. Phase 2: Validation
    • Test redirect functionality and 404 logging.
    • Monitor database performance (indexes, query times).
  3. Phase 3: Optimization
    • Adjust remove_not_founds based on testing.
    • Implement caching for redirect lookups if needed (e.g., Symfony cache pool).
  4. Phase 4: Rollout
    • Deploy to staging/production.
    • Monitor for issues (e.g., 404 logging slowdowns).

Operational Impact

Maintenance

  • Bundle Updates:
    • Monitor for updates to agence-adeliom/easy-redirect-bundle and easy-common-bundle.
    • Test upgrades in a staging environment before production deployment.
  • Dependency Management:
    • EasyAdmin/Symfony version upgrades may require bundle updates.
    • Downgrading Symfony/EasyAdmin could break compatibility.
  • Customizations:
    • Overridden entity classes or form types must be maintained separately.

Support

  • Troubleshooting:
    • Debugging redirect issues may require checking:
      • Database records (redirect/not_found tables).
      • EasyAdmin configuration and menu items.
      • Symfony event listeners (if custom logic is added).
    • 404 logging issues could stem from:
      • Database connection problems.
      • Permission issues (e.g., Doctrine not writing to tables).
  • Community/Documentation:
    • Limited stars/issues suggest lower community activity. Rely on:
      • GitHub issues for bug reports.
      • Source code for implementation details (documentation is minimal).

Scaling

  • Performance:
    • Redirect Lookups: Ensure the path column in the redirect table is indexed. For high traffic, consider:
      • Caching redirect rules (e.g., Symfony cache or Redis).
      • Using a more performant database (e.g., PostgreSQL with partial indexes).
    • 404 Logging:
      • High-volume sites may need to:
        • Batch inserts (e.g., using Doctrine batch operations).
        • Implement retention policies (e.g., archive old logs).
        • Offload logging to a queue (e.g., Symfony Messenger).
  • Database Growth:
    • The not_found table could grow large. Plan for:
      • Regular cleanup of old records.
      • Archiving strategies (e.g., move logs >30 days old to a separate table).

Failure Modes

Failure Scenario Impact Mitigation
Database migration fails Redirects/404s won’t work Test migrations in staging; use --dry-run to preview changes.
EasyAdmin dashboard broken Admins can’t manage redirects Backup existing dashboard config; test post-installation.
404 logging disabled Loss of analytics data Monitor logging functionality; set up alerts for failed database writes.
Redirect loop (e.g., A→B→A) Infinite redirects Validate redirect paths in the admin form; add cycle detection.
High traffic causes slowdowns Degraded performance Implement caching; optimize database queries.
Bundle conflicts with other packages Broken functionality Isolate bundle in a test environment; check for overlapping dependencies.

Ramp-Up

  • Developer Onboarding:
    • Document the new redirect management workflow for the team.
    • Highlight key configuration options (e.g., remove_not_founds).
  • Admin Training:
    • Train non-technical admins on using the EasyAdmin redirect interface.
    • Provide screenshots/guides for common tasks (e.g., creating redirects, viewing 404 stats).
  • Knowledge Transfer:
    • Record lessons learned from testing (e.g., performance bottlenecks, edge cases).
    • Create runbooks for common issues (e.g., "Redirect not working? Check the database record.").
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