Look at the following part of my application structure:
App
-Events
-Http
--Controllers
---Rest
-Services
--Base
--Primary
What I would like to do is to use the namespace App\Services
for all services and the namespace App\Http\Controller
for all controllers.
This is how my application is loaded with Composer:
"autoload": {
"psr-4": {
"App\\": "app/"
} }
This is the Exception I get:
(1/1) FatalThrowableError Class 'App\Services\CapabilityService' not found
CapabilityService
exists for sure, but it is within the subfolder Primary
. Is there a way to autoload files from subdirectories into one namespace together? If yes how and is there any important reason not to do it?
This is the CapabilityService:
namespace App\Services;
This is the location:
App/Services/Primary/CapabilityService