5 months ago

How to 'compose' the route definitions?

Posted 5 months ago by realtebo

I have this main group

    'prefix' => 'backend',
    'middleware' => ['web']
], function () {

Inside it, I've this subgroup

        'middleware' => ['auth']
    ], function () {

With another subgroup

            'namespace' => 'Users',
            'prefix' => '',
        ], function(){

And inside this I've a tons of routes. I'd like to splite route definitions in a few files and the 'compose' the final route files.

I'd like to avoid brutal require (...).

Is there a way to load some routes from a file/class/helper/whatelse and 'inject' in the final file in the appropriate row? Like a blade has inclusion methods, ... something similar

Please sign in or create an account to participate in this conversation.