- Does this bundle work with Laravel or only Symfony?
- This bundle is designed exclusively for Symfony applications using EasyAdmin. If you're using Laravel, you’ll need a different package like Laravel Breeze or Jetstream, which are tailored for Laravel’s Eloquent ORM and Blade templates.
- What versions of Symfony and EasyAdmin does this bundle support?
- The latest version (3.x) supports Symfony 6.4 and 7.x, while the 2.x branch covers Symfony 5.4 and 6.x. Ensure you’re using EasyAdmin 4.x or later, as older versions may not integrate properly. Check the [README](https://github.com/agence-adeliom/easy-admin-user-bundle) for branch-specific details.
- How do I install and configure this bundle in my Symfony project?
- First, add the Flex recipe endpoint to your `composer.json` under `extra.symfony.endpoint`, then run `composer require agence-adeliom/easy-admin-user-bundle`. After installation, run `php bin/console easy-admin-user:install` to publish configurations. Finally, set up your database using Doctrine migrations (`doctrine:migration:diff` and `doctrine:migration:migrate`).
- Can I customize user roles or add additional fields to the user entity?
- The bundle provides basic user management with roles (user, admin, super-admin), but extending it for custom fields or roles requires modifying the bundle’s entity classes and templates. This may involve overriding bundle templates or creating custom migrations. Always back up your code before making changes.
- Is this bundle actively maintained? What if Symfony or EasyAdmin updates break compatibility?
- The bundle’s last commit was around 2023, and it’s not actively maintained. If future Symfony or EasyAdmin updates break compatibility, you may need to fork the repository, apply patches, or switch to an alternative like SonataAdminBundle, which has a larger community and more frequent updates.
- Does this bundle support password reset tokens with expiration or rate limiting?
- The bundle includes a password reset flow using Symfony’s Security component, which handles token generation and validation. However, expiration and rate-limiting settings are not explicitly documented. You may need to configure these manually in the bundle’s security.yaml or override the reset controller logic.
- Can I use this bundle with a non-Doctrine database (e.g., raw SQL, Eloquent, or Propel)?
- This bundle assumes Doctrine ORM for database operations, so it won’t work out-of-the-box with Eloquent, Propel, or raw SQL. If you’re not using Doctrine, consider alternatives like Laravel’s built-in auth scaffolding or Symfony’s MakerBundle for custom user management.
- How do I create users programmatically or via CLI?
- Use the `easy-admin:add-user` command to create users interactively or via script. For example, `php bin/console easy-admin:add-user user@example.com password123 --admin` creates an admin user. You can also integrate this logic into your own scripts by using the bundle’s `UserManager` service.
- Are there any security risks I should be aware of when using this bundle?
- The bundle relies on Symfony’s Security component for authentication and password hashing, which is generally secure. However, ensure you’ve configured CSRF protection for forms and consider adding rate limiting to login and password reset endpoints. Always audit custom logic or extensions for vulnerabilities like SQL injection or brute-force attacks.
- What are some alternatives to this bundle for Symfony user management?
- If this bundle doesn’t fit your needs, consider SonataAdminBundle (more feature-rich but complex), FOSUserBundle (flexible but requires setup), or Symfony’s MakerBundle for generating custom user entities. For Laravel, packages like Laravel Fortify or Sanctum are better suited.