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

Routes

Modules should not define routes, boxes are expected to. An App may or may not want to use routes provided by a box. Registering of routes therefore can be enabled in the box config very similarly to views.

return [
    'modules' => [
        Vendor\MyBox\Providers\BoxServiceProvider::class => [
            'routes' => [
                'files'=> ['web', 'api']
            ], // register specific routes
            'routes' => true, // register all routes in the folder (*.php) 
            'routes' => false // don't register any routes
        ]
    ]
];

All routes will be included in a route group whose parameters can also be configured:

return [
    'modules' => [
        Vendor\MyBox\Providers\BoxServiceProvider::class => [
            'routes' => [
                'files'     => ['web', 'api'],
                'namespace' => 'Name\\Space\\Here', // Defaults to the module's route namespace
                'prefix'    => 'url_prefix', // Defaults to the module's short name
                'as'        => 'route.prefix.', // default is module's short name and a dot ('.') at the end
                'middleware'=> ['web', 'auth', 'acl'] // defaults to ['web']
            ]
        ]
    ]
];

Multiple Route Groups

To register routes with different settings (v1.3+):

return [
    'modules' => [
        Vendor\MyBox\Providers\BoxServiceProvider::class => [
            'routes' => [
                [
                    'files'     => ['acl'],
                    'prefix'    => '/admin',
                    'as'        => 'admin.',
                    'middleware'=> ['web', 'auth', 'acl']
                ],
                [
                    'files'     => ['nonacl'],
                    'prefix'    => '/admin',
                    'as'        => 'admin.',
                    'middleware'=> ['web', 'auth']
                ]
            ]
        ]
    ]
];

Route Model Bindings

Up until Concord v1.6, all the models that were registered with Concord were automatically bound to the Laravel router by implicitly calling the Route::model() method.

See: https://laravel.com/docs/7.x/routing#route-model-binding

Eg. if your module defines a Product model, then Concord calls Route::model('product', Product::class) upon registering the model.

As of v1.7.0 this behavior can be disabled, by setting the register_route_models configuration to false in your app's config/concord.php file:

// config/concord.php
return [
    'register_route_models' => false,
    'modules' => [
        // list of modules here...        
    ]
];

This will prevent Concord from automatically registering models with the router.

Next: Resources »

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