avored / laravel-ecommerce

AvoRed an Open Source Laravel Shopping Cart
https://avored.com
1.51k stars 549 forks source link

Missing autoload #390

Closed james2doyle closed 2 years ago

james2doyle commented 5 years ago

Describe the bug A composer package cannot be found: Class 'AvoRed\CashOnDelivery\Module' not found

To Reproduce Steps to reproduce the behavior:

  1. Clone master
  2. composer install
  3. See error

Screenshots

Screen Shot 2019-09-29 at 11 41 54 AM

Additional context I think the reason is that the modules folder is not autoloaded properly. The error can be fixed with the following patch:

diff --git a/composer.json b/composer.json
index 55c37632..190cf475 100644
--- a/composer.json
+++ b/composer.json
@@ -34,7 +34,8 @@
     },
     "autoload": {
         "psr-4": {
-            "App\\": "app/"
+            "App\\": "app/",
+            "AvoRed\\": "modules/avored/"
         },
         "classmap": [
             "database/seeds",
indpurvesh commented 5 years ago

@james2doyle Make sure that you have file exist at these location. modules/avored/cash-on-delivery/src/Module.php.

Yes, i am setting the autoloading in programming so you don't have to add it into composer.json.

james2doyle commented 5 years ago

Yeah they exist. I cloned this yesterday from master. They autoloading seems to not be working at the moment unless set explicitly

james2doyle commented 5 years ago

If they files didn’t exist, my patch to composer.json wouldn’t have worked

indpurvesh commented 5 years ago

@james2doyle It is very interesting. I can't replicate the bug in my local. If it happens with others too then there might be a bug in Module/Manager.php file. (This file is part of the framework)