ahmad
ahmad

Reputation: 1

In Laravel 11 NWidart Module Class "Modules\Test\Providers\TestServiceProvider" not found

I create a new Laravel 11 project and I am trying to run php artisan route:list then it gives error: Class "Modules\Test\Providers\TestServiceProvider" not found, after I install new module

I want to get route list without error Class "Modules\Test\Providers\TestServiceProvider" not found

Upvotes: -1

Views: 191

Answers (1)

Boubacar Sy
Boubacar Sy

Reputation: 11

I think in version 11 you don't need to add Modules stuff in psr-4.
Add this to compose.json and run composer dump-autoload, it worked for me, i just created a new project.
Go with this README documentation:

"extra": {
    "laravel": {
        "dont-discover": []
    },
    "merge-plugin": {
        "include": [
            "Modules/*/composer.json"
        ]
    }
},

Upvotes: 1

Related Questions