Put them anywhere you want.
I would suggest you put them in app/helpers.php
and then require
that file in app/start/global.php
or add them in app/helpers
(new folder) and then autoload that folder with composer.
"autoload": {
"classmap": [
...
"app/helpers",
...
]
},
Great, I'll go with directory version. Thanks!
Also consider PSR-4, also in composer.json:
"psr-4" : {
"YourNamespace\\" : "app/YourNamespace"
}
Don't forget to do composer dump-autoload in the terminal.
You can now drop in classes like this with no manual configuration required, or even touching composer:
// app/YourNamespace/Foo/bar.php
namespace YourNamespace\Foo;
class Bar{}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community