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

Concord Laravel Package

konekt/concord

Laravel extension for building modular applications using conventions on top of service providers. Manage in-app and external modules with isolation-friendly structure, version compatibility across Laravel releases, and tooling around module registration and organization.

View on GitHub
Deep Wiki
Context7

Helpers

Freely based on the idea of Magento helpers. These kinds of classes are often required in views where using namespaces isn't very elegant, and pushing instances from controllers would just increase noise.

So Concord's idea is that helpers are generally just services registered in the service container but they can be reached via an abbreviated call like helper('money')->helperMethod() or if you register the Helper facade Helper::get('money')->helperMethod().

Helpers instances are singletons.

Registering Helpers

You can register helpers with Concord's registerHelper() method:

concord()->registerHelper('helper_name', HelperClass::class);

You can access this helper via helper('helper_name')->someMethod(), which gives you short access to HelperClass's someMethod().

Registering helpers actually adds the class name as a singleton in the container as concord.helpers.helper_name key. Thus accessible via app('concord.helpers.helper_name') as well.

Helpers need to be registered either in a module's ModuleServiceProvider or in the AppServiceProvider classes boot() method:

    public function boot()
    {
        parent::boot();
        
        // In ModuleServiceProviders:
        $this->concord->registerHelper('product', ProductHelper::class);
        // in AppServiceProvider:
        $this->app->concord->registerHelper('product', ProductHelper::class);
    }

This makes you possible using helper('product')->someMethod().

Next: Views »

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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4