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

Core Bundle Laravel Package

brix/core-bundle

CoreBundle is the foundation bundle for BrixCMS, providing the core services and infrastructure used by the CMS and related bundles.

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation Add the package via Composer:

    composer require alexandrekilian/core-bundle
    

    Register the bundle in config/bundles.php:

    return [
        // ...
        AlexandreKilian\CoreBundle\CoreBundle::class => ['all' => true],
    ];
    
  2. First Use Case Publish the default configuration:

    php artisan vendor:publish --tag=core-bundle-config
    

    Verify the config file is generated at config/core.php.

  3. Basic Usage Access core services via Laravel's container:

    $coreService = app('core.service');
    

Implementation Patterns

Core Workflows

  1. Service Integration Inject the core service into controllers or commands:

    use AlexandreKilian\CoreBundle\Service\CoreService;
    
    class MyController extends Controller
    {
        public function __construct(private CoreService $coreService) {}
    }
    
  2. Event Handling Listen to core events (if documented):

    event(new \AlexandreKilian\CoreBundle\Event\CoreEvent());
    
  3. Configuration Overrides Extend the published config:

    'core' => [
        'my_custom_setting' => env('CUSTOM_VALUE', 'default'),
    ],
    

Common Use Cases

  • CMS Core Features: Use the bundle as a foundation for BrixCMS (e.g., routing, middleware, or utility services).
  • Dependency Injection: Leverage the bundle’s services for shared logic (e.g., localization, caching, or security).

Gotchas and Tips

Pitfalls

  1. Lack of Documentation

    • The package has no stars, dependents, or clear documentation. Assume minimal API stability.
    • Check src/Service/ and src/Event/ for undocumented features.
  2. Configuration Quirks

    • The vendor:publish tag (core-bundle-config) may not exist. Verify with:
      php artisan vendor:publish --tag=core-bundle-config --dry-run
      
    • If missing, manually create config/core.php with default values.
  3. Namespace Conflicts

    • The bundle uses AlexandreKilian\CoreBundle. Ensure no naming collisions with other packages.

Debugging Tips

  • Service Availability: Use app()->has('core.service') to check if the service is registered.
  • Event Debugging: Dump events in EventDispatcher listeners:
    $dispatcher->addListener(\AlexandreKilian\CoreBundle\Event\CoreEvent::class, function ($event) {
        \Log::debug('Core event triggered:', $event->toArray());
    });
    

Extension Points

  1. Custom Services Bind extensions to the container:

    $this->app->bind('core.extension', function () {
        return new MyCoreExtension();
    });
    
  2. Middleware Integration If the bundle provides middleware (e.g., CoreMiddleware), register it in app/Http/Kernel.php:

    protected $middleware = [
        // ...
        \AlexandreKilian\CoreBundle\Http\Middleware\CoreMiddleware::class,
    ];
    
  3. Event Subscribers Subscribe to core events (if available) in EventServiceProvider:

    protected $listen = [
        \AlexandreKilian\CoreBundle\Event\CoreEvent::class => [
            MyCoreEventHandler::class,
        ],
    ];
    
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.
bugban/symfony
beyonder-capi/workflow-extensions-bundle
beyonder-capi/job-queue-bundle
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin