Skip to content

Question : Creating user #232

Open
Open

Description

@harikt

In the documentation of creating user https://stack.sylius.com/cookbook/admin_panel/security#create-a-user-entity , we are creating user from command bin/console make:user .

In monofony iirc the sylius user bundle was reused. Question is can we use sylius/user-bundle or other bundles to make this happen ?

Activity

  1. Prometee commented on Feb 7, 2025

    @Prometee
    Contributor

    Hello @harikt!

    Yes you can and I already did it on my own Sylius Stack project but it requires you to copy many classes from SyliusCoreBundle and SyliusAdminBundle.

    Here is a non exhaustive list of a minimal integration (No admin avatar image):

    • Copy the Core AdminUser entity and add the PHP Attributes to setup the doctrine entity (remove AvatarImage relation).
    • Add PHP attributes to set the various Constraints on the fields.
    • Copy the EventListeners CanonicalizerListener .
    • Copy the Form (removing AvatarImage relation.
    • Copy the user creation console command as well as the Command and CommandHandler and the related Exception.
    • Create a grid, a SYlius Resource config.
    • Add the admin user route to the main menu.
    • Copy templates and avoid copy of the LiveComponent (because there no avatar to handle).
    • Config twig hooks.
    • [optional] Tweak the login page to add forget password feature.

    Adding the Avatar Image is possible too but requires much mre class and templates to copy from SyliusCore.

  2. added
    documentationImprovements or additions to documentation
    questionFurther information is requested
    on Feb 7, 2025
  3. harikt commented on Feb 7, 2025

    @harikt
    ContributorAuthor

    Thank you @Prometee . I was expecting some sort of symfony pack which will help to speed up the process.

  4. Prometee commented on Feb 7, 2025

    @Prometee
    Contributor

    Maybe a recipe can be setup to do this automatically, I know that @loic425 think about doing this for other kind of auto config.

  5. loic425 commented on Feb 7, 2025

    @loic425
    Member

    Yes, I've some Symfony packs that are on WIP state.
    I'll have to finish them soon cause we need them in my company to start future projects.
    As you know, I'm not in favour of using sylius user package. It's on the main repo, it's hard to maintain it with Symfony changes and there's a lot of way to handle authentications in a project. That's why there's no Symfony user package anymore, only extra tools.
    My current work is only for admin users and it's using a DDD architecture.

  6. harikt commented on May 6, 2026

    @harikt
    ContributorAuthor

    Hi @loic425 ,

    I have not been following properly, so is there any updates already done on this?

    Sorry to bother, I love to hear ie why.

    Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationgood first issueGood for newcomersquestionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions