0

I am having cache issues on my website, i ran all the artisan cache

but it didn't resolve my caching issues. So, I tried to run the composer dump-autoload command and i have been having the following issues.

composer dump-autoload
Generating optimized autoload files
Warning: Ambiguous class resolution, "App\Mail\WelcomeEmail" was found in both "/var/www/html/jupiterweb/app/Mail/WelcomeEmail.php" and "/var/www/html/jupiterweb/app/Mail/WELCOMEmail.php", the first will be used.

In AutoloadGenerator.php line 288:

  file_put_contents(/var/www/html/jupiterweb/vendor/composer/autoload_namespaces.php): failed to open stream: Permission denied 

I only have this WelcomeEmail.php file to my server but not WELCOMEEmail.php

plus it talks about permission issue

file_put_contents(/var/www/html/jupiterweb/vendor/composer/autoload_namespaces.php): failed to open stream: Permission denied 
Jonib
  • 137
  • 1
  • 8
  • The snippet you've shared has to do with Composer caching packages locally to make future installs / updates faster. It shouldn't impact your application code. The ambiguous class issue might be due to how you've configured autoloaders in `composer.json` - make sure you don't have a PSR-4 and classmap entry covering the same folder(s). If neither of those helps, you may need to revise your question with more information. – Aken Roberts Jul 14 '20 at 20:16
  • @AkenRoberts, i have re-written my question again by adding some extra details. – Jonib Jul 14 '20 at 20:30

1 Answers1

0

Sounds like cached-cache, or something. Anyways, try this:

  1. Delete bootstrap/cache/
  2. Create directory: bootstrap/cache (needs to be present)
  3. Run: composer clear-cache && composer dump-autoload -o

"-o" will convert PSR-0/4 autoloading to classmap to get a faster autoloader

PatricNox
  • 3,306
  • 1
  • 17
  • 25
  • what is the -o flag with composer? sounds like it will start cache optimization again. i don't want to add cache to my website anymore. it is always giving me problems. what do you recommend? – Jonib Jul 15 '20 at 22:48
  • Cache is something that will speed up your website alot, it's absolutely not recommended to avoid it.. `-o` flag will convert PSR-0/4 autoloading to classmap to get a faster autoloader. – PatricNox Jul 15 '20 at 22:50
  • i am using laravel only for the backend API and on frontend react. does cache still help? plus some of my users could access my website and it loads the data and others could access my website but data doesn't load .. then i have to clear the cache then it works – Jonib Jul 15 '20 at 23:27