0

I have installed laravel packages on staging server and packages working fine. But when i take pull on staging server, it is showing me error that package class not found.

Steps I have followed to resolve issue

  1. I have check in vendor folder as well as in config/app.php, but I got class declaration and package folder is there.
  2. After this when I update composer, my issue get resolved.

Is there any other file which should i look for class defination?

SA Vartak
  • 1
  • 2
  • 1
    Welcome to SO ... never run `update composer` on server it should be in local and test newer verion work then only move to live then in server run `composer install --prefer-dist --no-scripts --no-progress --no-suggest --no-interaction --no-dev` – Kamlesh Paul Jun 14 '21 at 07:01
  • https://stackoverflow.com/questions/42065931/why-should-i-never-run-composer-update-in-production for more info – Kamlesh Paul Jun 14 '21 at 07:01

1 Answers1

0

Perform a composer update, then composer dump-autoload.

If the above doesn't solve the problem, change the classmap in your composer.json file such that it contains the project-relative path to your php files:

"autoload-dev": {
"classmap": [
    "tests/TestCase.php",
    "database/seeds/UserTableSeeder.php" //include the file with its path here
]},

and soon after, perform a composer dump-autoload, and it should work now

Istiake
  • 41
  • 1
  • 7