Ranx99
192
3
Laravel

How to use php:artisan outside App folder?

Posted 2 months ago by Ranx99

I am structuring my app as modules, something like this

app/
bootstrap/
modules/
   -- Blog/
        --- Config/
        --- Console/
        --- Exceptions/
        --- Database/
                migrations/
                seeders/
                factories
        ---  Models/
        ---  Http/
                Controllers/
                Middleware/
        --- Providers/
        --- Resources/
        --- Routes/
                api.php
                web.php
        --- Tests/
   -- Backend/
   -- Frontend/
   -- Other modules etc..
config/
database/
public/
vendor/
resources/
other folders etc..

How can I use artisan to make controllers, migrations, providers ... etc, inside a specific module?

For example lets say I am in this location: [email protected]:~/code/myblog/modules/Blog$

Is there a way to use artisan here? so when I do php artisan make:controller TestController it will be placed in Blog/Http/Controllers

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