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

User Bundle Laravel Package

bengor/user-bundle

View on GitHub
Deep Wiki
Context7

Domain events and subscribers

The BenGorUser's User library has some built-in subscribers that need to be added to make them work, the bundle does not register them by default.

The declaration mainly relies in the tag name bengor_user_your_user_type_event_subscriber and the subscribe to parameter. In the tag name you will need to change your_user_type by your user type and in the subscribes to you will need to add a fully qualified name you want to listen to.

A whole list of default events is available in the BenGorUser's standalone library docs

User Invited Event Subscriber:

app.invite_url_generator:
    public: false
    class: BenGorUser\SymfonyRoutingBridge\Infrastructure\Routing\SymfonyUserUrlGenerator
    arguments:
        - "[@router](https://github.com/router)"
        - bengor_user_your_user_type_sign_up

app.invited_mailer_subscriber:
    class: BenGorUser\User\Domain\Event\UserInvitedMailerSubscriber
    arguments:
        - "[@bengor_user](https://github.com/bengor_user).mailer.swift_mailer"
        - "[@bengor_user](https://github.com/bengor_user).mailable_factory.invite"
        - "[@app](https://github.com/app).invite_url_generator"
    tags:
        -
            name: bengor_user_your_user_type_event_subscriber
            subscribes_to: BenGorUser\User\Domain\Model\Event\UserInvited
        -
            name: bengor_user_your_user_type_event_subscriber
            subscribes_to: BenGorUser\User\Domain\Model\Event\UserInvitationTokenRegenerated

User Registered Event Subscriber:

app.sign_up_url_generator:
    public: false
    class: BenGorUser\SymfonyRoutingBridge\Infrastructure\Routing\SymfonyUserUrlGenerator
    arguments:
        - "[@router](https://github.com/router)"
        - bengor_user_your_user_type_enable

app.registered_mailer_subscriber:
    class: BenGorUser\User\Domain\Event\UserRegisteredMailerSubscriber
    arguments:
        - "[@bengor_user](https://github.com/bengor_user).mailer.swift_mailer"
        - "[@bengor_user](https://github.com/bengor_user).mailable_factory.sign_up"
        - "[@app](https://github.com/app).sign_up_url_generator"
    tags:
        -
            name: bengor_user_your_user_type_event_subscriber
            subscribes_to: BenGorUser\User\Domain\Model\Event\UserRegistered

User Request Remember Password Event Subscriber:

app.request_remember_password_url_generator:
    public: false
    class: BenGorUser\SymfonyRoutingBridge\Infrastructure\Routing\SymfonyUserUrlGenerator
    arguments:
        - "[@router](https://github.com/router)"
        - bengor_user_your_user_type_change_password

app.request_remember_password_mailer_subscriber:
    class: BenGorUser\User\Domain\Event\UserRememberPasswordRequestedMailerSubscriber
    arguments:
        - "[@bengor_user](https://github.com/bengor_user).mailer.swift_mailer"
        - "[@bengor_user](https://github.com/bengor_user).mailable_factory.request_remember_password"
        - "[@app](https://github.com/app).request_remember_password_url_generator"
    tags:
        -
            name: bengor_user_your_user_type_event_subscriber
            subscribes_to: BenGorUser\User\Domain\Model\Event\UserRememberPasswordRequested

Remember that alternatively you can use the plain strategy of the user url generator avoiding the SymfonyRoutingBridge dependency. The following code is a declaration of this implementation:

app.invite_url_generator:
    public: false
    class: BenGorUser\User\Infrastructure\Routing\PlainUserUrlGenerator
    arguments:
        - "http://kreta.io?token={token}"
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