Laravel Composer Update Modified Files

I need to tell a very important thing for me (perhaps for all users who use the composer in their projects). I am working on laravel. Whenever I work on my local machine, I start updating the composer after adding a new library to the vendor.

Now it works fine on the local machine. But when I upload these files to my server, it removes the error, for example, "Undefine class ....". I do not know how to execute the linker update command on the server (it may also be unsafe).

So I can just find out which files are being updated using composer updatein cmd. What other files need to be continued to avoid this error?

+4
source share
3 answers

You can:

  • Run composer updateonly on your local server whenever you want.
  • Commit / push all files (including composer.lock) , but directoryvendor
  • Deliver to your production server (without vendor, composer.lock)
  • Then run composer installon your production server. It will update all your dependencies according to yours composer.lock(so the exact versions are the same as your last update on your local server).

: composer update , composer install ( composer.lock)

, .

+4

composer dump-autoload composer update. , composer clear-cache

+2

composer update .

, , , composer install

"undefined class" app.php. app.php, () .

, :

  • --no-scripts;
  • , app.php,
  • dump-autoload
+1

Source: https://habr.com/ru/post/1670288/


All Articles