lundi 13 avril 2020

Loading multiple custom nested routes in Laravel

I created a long list of custom route files, and I can't figure out the correct way to load them, and they're separated in multiple folders/nested folders in the Routes directory as follow :

Routes:
    custom_routes:
        auth.php
        general.php
        export.php
        admin:
            customers:
                customer.php
                list.php
            users:
                user.php
                // ...
            invoices:
                user.php
                // ...
            settings:
                user.php
                // ...
        front:
            account:
                settings:
                    setting.php
                    account.php
                    //...
            cart:
                cart.php
                //...
            contact:
                contact.php
                //...
    api.php
    channels.php
    console.php
    web.php

If they were just 1 or 2 additional files I would have added them using the RouteServiceProvider, but in this case there is a lot of them and in multiple nesting levels/folders.

How can I do this the right way?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire