I created a small application using Laravel 5.2. I saved all my work in the "Modules" folder located at App/Modules.
Now I am trying to move my folder Modulesto the root directory "outside the application folder". So, my folder is Modulesnow next to App.
I want to automatically load a folder Modules, as in a folder App.
To automatically load Modules, I modified myautoload section of mycomposer.json`, look like this:
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/",
"Modules\\": "modules/"
}
},
Also, in the configuration file, app.phpI added this service provider to my "providers" array
Modules\Vendname\Surveys\Providers\CoreValidatorServiceProvider::class,
Then from the command line I executed the following command
composer dumpautoload
, ,
FatalErrorException in ProviderRepository.php line 146: Class 'Modules\Vendname\Surveys\Providers\CoreServiceProvider' not found
CoreServiceProvider.php
<?php
namespace Modules\Vendname\Surveys\Providers;
use Illuminate\Support\ServiceProvider;
class CoreServiceProvider extends ServiceProvider
{
public function boot()
{
if (! $this->app->routesAreCached()) {
require __DIR__ . '/../routes.php';
}
}
public function register()
{
}
}
?
?