Skip to content

Instantly share code, notes, and snippets.

@cavearr
Created January 16, 2019 11:55
Show Gist options
  • Save cavearr/6dc64ae43056d5d044b9faac384f7231 to your computer and use it in GitHub Desktop.
Save cavearr/6dc64ae43056d5d044b9faac384f7231 to your computer and use it in GitHub Desktop.
[COMPOSER] autoload your own classes
1) Create your directory structure for your code (case sensitive)
2) Add autoload object to composer.json:
"autoload": {
"psr-4": {
"Your-Namespace\\" : "your-dir/"
}
}
3) update autoloader: composer dump-autoload
4) use your classes and namespaces.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment