I am having a hard time trying to find the best way to solve this problem.
I upload all my files except vendor files to git repository and pull them on the server using git.
But when i add service providers to config.php , php clear-compiled command throws an error on the server while doing composer update or composer install on the server because it doesn't exist yet as i haven't updated composer yet.
I can get through the problem by editing composer.json and removing those pre-post clear-compiled commands but i was looking for a better way to solve this.
Have you guys faced this problem?
If you have a suggestion then please let me know!
When you try to run a composer update, it will first try to do php artisan clear-compiled. It will not work since there are no dependencies yet installed.
You need to run first
composer install
and then everything should be working fine!
If composer install does not work you might wanna clone or pull your git repo again.