'Autoloading nested files?
In my Laravel package I have some of my model traits under /src/Models/Traits.
The src folder is autoloaded in composer.json:
"autoload": {
"psr-4": {
"Acme\\Package\\": "src"
......
Therefore any file under src can be used in the packages parent application by:
use Acme\Package\SomeHelper;
Is there a way to keep my traits under /src/Models/Traits but have them accessible in parent applications like:
use Acme\Package\SomeTrait;
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
