Closed hayjay closed 1 year ago
@hayjay checking this now. Thanks for bringing this to my attention.
@hayjay This has been fixed now. Please uninstall the package and install again. Thanks so much for catching this. This was a huge oversight.
@unicodeveloper Thanks very much, I have re-tested and it works perfectly now.
Awesome. I'm glad it works perfectly now.
No problem, thanks for the support too.
What is this issue about ?
After requiring this package in a project (a php project and in a php framework), instantiating the Novu class as mentioned in the
README
file throws an error saying that theNovu\SDK\Novu
page isn't found.How can it be reproduced
Step 1: require this package in a php project -
composer require unicodeveloper/novu
as stated in theREADME
Step 2: Import the name space in a php fileuse Novu\SDK\Novu;
Step 3: Instantiate the Novu class$novu = new Novu(<INSERT_API_KEY_HERE>);
Expected error message in a PHP project (without framework):
Fatal error: Uncaught Error: Class "Novu\SDK\Novu" not found
Useful files/attachments
Investigation/Possible Solution
From the above screenshot (In the composer.json file) where the project src directory is been autoloaded i.e in the psr-4 autoload object, there seems to be a wrong-spelling of the alias names
"Nova\\SDK\\"
where the src directory is aliased, I would assume that it's supposed to be"Novu\\SDK\\" and not
"Nova\SDK\" - key difference here seems to be Nova and Novu.For me, I think this is just a mistake since the project classes and actions uses a different namespace as seen below:
The namespaces used are incorrect since the alias in the composer.json has a different spelling with the class namespaces as seen above.
Please let me know if I am wrong or if everything is done as expected and I will try to continue investigating what might have gone wrong with my installation.
Thanks for the good work!