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

Using existing use cases

To use one of the existing commands you just need to select the proper bus and select the command you want to use. One bus is created for each user type so select the correct one.

In the following examples EnableUserCommand is used to demonstrate the usage of the command bus. In case you want the whole list check command reference in the BenGor User library. The usage is the same, a command instance needs to be passed as first parameter of the handle() method of the command bus.

In case you are triggering the command from a Symfony controller do the following replacing $userType by your user type.

$this->get('bengor_user.' . $userType . '.command_bus')->handle(
    new EnableUserCommand($confirmationToken)
);

In case you want to trigger the command from a Symfony service you need to inject it in as usual, replacing your_user_type by your user type.

# app/config/services.yml
services:
    app.your_service:
         class: AppBundle\Service\YourService
         arguments: ['[@bengor_user](https://github.com/bengor_user).your_user_type.command_bus']
// src/AppBundle/Service/YourService.php

use  BenGorUser\User\Infrastructure\CommandBus\UserCommandBus;

class YourService 
{
    private $commandBus;
    
    public function __construct(UserCommandBus $commandBus) 
    {
        $this->commandBus = $commandBus;
    }
    
    public function doWhatever($confirmationToken) 
    {
       $this->commandBus->handle(
            new EnableUserCommand($confirmationToken)
       );
    }
}
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