Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

yulquen's avatar

Best approach to update Laravel?

For the last releases and updates (to 5.1 and recently to 5.2) i've had some troubles with updating Laravel. Missing files in the vendor folder due an outdated/non-updating composer cache for example. I've had to manually delete both the composer cache and the vendor folder entirely to get the latest updates from the git repo when i did an composer update/install. On the 5.1 update for some reason a file was missing as well in my local vendor folder. Or i've had to delete the bootstrap/compiled.php file to solve errors.

For my local dev environment this might be ok as i'm working on updating the sources to the latest version. But i've had to do this stuff also manually on Forge, because Forge couldn't deploy the changes automatically.

So what would be a good approach to do when a new Laravel version drops and i've want to update stuff?

0 likes
2 replies
ohffs's avatar

Write down everything you come across when updating locally and then use that as the basis for a script/procedure to update production? I don't mean to come across as flippant - really :-) But that's about the best you can do without using something like laravel shift - which is really just outsourcing that process I guess.

If you're on linux/os-x there's a handy cli tool called 'script' which can be helpful, for instance :

script update-this-laravel.log

That will start another shell and everything you type or that is displayed back will be recorded - just exit the shell once you're done and you can go back through later and see everything you did. It's handy when you're not quite sure what might be broken or you need to do.

yulquen's avatar

Yeah, i can note down any commands, that were executed during the update process. And execute each of these commands manually when i update the live system.

But i my mind, this would not look like a solid-proof solution ;-) For small apps this would be a no-brainer sure, but for the big stuff it would be a hassle.

For example: Is it just me, or is it a regular behaviour that composer does not fetch a file from a repository although its committed and i can see it in the repo? For the 5.2 update it was missing the file Illuminate\Auth\Access\AuthorizationException.php. I can remember in 5.1 there also was some trouble with composer not fetching some file. As mentioned above, i've had to manually delete the composer global cache and the vendor folder entirely.

When possible, i would like to have a less error prone solution for that. At least for the stuff, that is not on my end of the desk (like composer stuff, cache files and so on). In other words: When i'm ready to deploy i want to automate the deployment process as much as possible. I don't bother any downtime during the deployment process or having an broken app during the deployment process. But when the deployment is done, the app should be up and running. It also doesn't matter if i use Forge, Envoyer or any other build/deployment tool. I just would like to see any best-practices for the deployment process itself.

Please or to participate in this conversation.