I am learning how to create my first composer package.
To achieve that, I created the following public repository on my GH: https://github.com/Alphabetus/alpha-logger.
I managed to successfully install my package on a project but when i try to call the class from the package i get the following error:
The package code is public as mentioned, am i assigning the namespace wrong? On the test project I have the following:
- composer.json:
[...]
"repositories": [
{
"type": "vcs",
"url": "https://github.com/Alphabetus/alpha-logger"
}
],
[...]
"require": {
[...]
"alphabetus/alpha-logger": "dev-master"
}
[...]
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
The composer update
command goes OK and i can see my own package on vendor/alphabetus/AlphaLogger
On my controller Im trying to call my logger class like this:
- PageController.php
use AlphaLogger\Logger as Logger;
[...]
public function index(... ...)
{
$l = new Logger();
$l->test();
}