Support the ongoing development of →
posted 10 years ago
Last updated 1 year ago.

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": [
Last updated 1 year ago.

Great, I'll go with directory version. Thanks!

Last updated 1 year ago.

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{}
Last updated 1 year ago.

Sign in to participate in this thread!


Your banner here too?

akalajzi akalajzi Joined 9 Feb 2014


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.