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

Base Bundle Laravel Package

bbit/base-bundle

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation

    composer require bbit/base-bundle
    

    Add to config/bundles.php:

    return [
        // ...
        BranchBit\BaseBundle\BranchBitBaseBundle::class => ['all' => true],
    ];
    
  2. First Use Case: Async Job Dispatch Create a command class (e.g., app/Commands/ProcessUser.php):

    namespace App\Commands;
    
    use BranchBit\AsyncDispatcherBundle\Command\CommandInterface;
    
    class ProcessUser implements CommandInterface {
        public function execute() {
            // Your logic here
        }
    }
    

    Dispatch it in a controller/service:

    use BranchBit\AsyncDispatcherBundle\Dispatcher\CommandDispatcher;
    
    $dispatcher = app(CommandDispatcher::class);
    $dispatcher->dispatch(new ProcessUser());
    
  3. Doctrine Extensions Enable in config/packages/doctrine.yaml:

    doctrine:
        orm:
            mappings:
                gedmo_timestampable: ~
    

    Add Gedmo\Timestampable\TimestampableEntity to your entities.


Implementation Patterns

Async Workflows

  • Queue Integration: Use SqsCommandQueueBundle for SQS-backed async jobs. Configure in config/packages/branchbit_base.yaml:
    branchbit_base:
        async_dispatcher:
            queue: 'your_sqs_queue_url'
    
  • Retry Logic: Implement CommandInterface with execute() and onFailure():
    public function onFailure(\Exception $e) {
        // Custom retry logic
    }
    

Doctrine Extensions

  • Soft Deletes: Add Gedmo\SoftDeleteable\SoftDeleteableTrait to entities.
    use Gedmo\SoftDeleteable\SoftDeleteableTrait;
    
    class User implements SoftDeleteable {
        use SoftDeleteableTrait;
    }
    
  • Lifecycle Callbacks: Use @ORM\PrePersist/@ORM\PostUpdate annotations.

Bundle Composition

  • Dependency Injection: Access sub-bundle services via app():
    $queue = app(\BranchBit\SqsCommandQueueBundle\Queue\SqsQueue::class);
    

Gotchas and Tips

Debugging

  • Async Jobs: Check SQS queue for stuck jobs. Use php bin/console branchbit:async:list (if CLI commands exist).
  • Doctrine Events: Ensure doctrine/doctrine-bundle is installed and configured.

Configuration Quirks

  • Missing Config: Sub-bundles may require separate configs (e.g., async_dispatcher.yaml for SQS credentials).
  • Doctrine Extensions: Requires doctrine/doctrine-extensions as a dependency (install manually if not auto-resolved).

Extension Points

  • Custom Commands: Extend BranchBit\AsyncDispatcherBundle\Command\AbstractCommand for shared logic.
  • Queue Adapters: Override SqsQueue to support other providers (e.g., RabbitMQ).

Pitfalls

  • No CLI Tools: Bundle lacks built-in CLI commands (check for branchbit:* commands).
  • Documentation: Sub-bundles may have undocumented features (refer to their repos).
  • Versioning: Sub-bundles may have separate release cycles (pin versions in composer.json).
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.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor