Support the ongoing development of Laravel.io →
Packages Architecture
Last updated 2 years ago.
0

Feel free to put your code wherever you want. Maybe there are some tips for doing it in a diferent way, but mostly the directory tree should be a personal choise and you can put your classes where you feel makes most sense for you. Also you're right with PSR-4, if you make app\MyClasses\Points.php then you could use your code something like new App\MyClasses\Points and will work. Remember to use composer dumpautoload before that.

Personally I sometimes use app\Classes, app\Classes\Interfaces, app\Classes\Abstracts for most basics projects.

Also, you could make a composer package and then a service provider and then a facade and share it with your friends or the comunity.

0

Thanks. Just wanted to check. I can create my own folders then.

By the way if follow PSR-4 rules, no need to autodump any more ;)

0

Sign in to participate in this thread!

Eventy

Your banner here too?

martynbiz martynbiz Joined 15 Feb 2015

Moderators

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

Your logo here?

Laravel.io

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

© 2024 Laravel.io - All rights reserved.