Back to Laravel Homestead from Sail / Docker

Shamsul Alam Jewel
2 min readJan 25, 2022

Going back to Laravel Homestead from Docker!!

I am having a situations where there are exactly 5 old websites, they are using PHP 7.1 and laravel 4.2 and 5.1, Yeah pretty old stuff and I have to upgrade them all to PHP8.1 and Laravel 8.

So my first job is to install all the web applications with the current requirements into my local machine (i.e, PHP7.1 and Laravel 4.2 and 51). Well I did it with Valet as I am now a Mac guy. Valet is the best when you don’t need multiple apps run at the same time with different PHP versions, As valet only supports One version of PHP at a time. So I did use Valet with PHP7.1 and install all the apps. And they worked well.

Now is the time to upgrade one-by-one. Now Valet is not serving me well as I need to do some updates on the previous apps while continuously upgrading to a new version of the apps. So i need parallel two PHP versions PHP7.1 and PHP8.1. And interesting is one of the app is responsible for the signing / logging, so for that I made an upgrade local domain of a sub-site apps and this app needs to communicate with the member system so HTTP / Curl has to support. So i thought to run the new upgraded apps with Laravel Sail which basically a Docker solution. I like sail as it’s make the dockerization of the apps much easier. But I start to face problem as the apps now can’t communicate with each other. Because the member-system for logging is running is valet! and the new site is in docker. I know I can take the member system in docker too? but then I can’t use sail! as sail does not support PHP7.1 it’s only supporting PHP7.4, PHP8.0 and PHP8.1 :(

I tried to go with a bit then decides it would be much easier for me to just use Laravel Homestead. As i can serve multiple sites with multiple PHP versions simultaneously and the communication part i don’t even need to think about it, it just works. I setup laravel homestead and now can focus on my work instead of setting up how sites will work, communicate, etc.

The only thing is the cons of using Laravel Homestead is that it’s make my computers fans running heavily and the sound I don’t like. But this is ok with me.

--

--