Local dev environment for old Laravel 5.2 app? (Windows)
I got an old Laravel 5.2 project that's not been updated for a good while. I used to use VirtualBox for local dev environment. It was a ok, but kept breaking with Windows or VirtualBox updates.
If you are interested in using Sail with an existing Laravel application, you may simply install Sail using the Composer package manager. Of course, these steps assume that your existing local development environment allows you to install Composer dependencies:
The machine I currently have has never been setup for webdev. The command that the docs describe:
composer require laravel/sail --dev
Is that something I can run from WSL? I'm a little confused to how/when I use Docker along with this.
It's been so long since I worked on this that the new tooling is unfamiliar to me and it's not entirely obvious how I can get my project running on my local machine so I can start upgrading it. Anyone able to give me some pointers?
@thomthom You won’t be able to use Sail, as Laravel 5.3 required PHP 5.5.9 or above, and the lowest version of PHP that Sail supports is 8.0.
You’d be best off installing a version of Homestead compatible with that version of Laravel (https://laravel.com/docs/5.2/homestead) and then going through the upgrade guides to update that application. If you leave it much longer, then Laravel 11 will be on the horizon (https://laravel.com/docs/10.x/releases#support-policy) and your task of upgrading to a current version will be more than what it is presently, and will only become a bigger and bigger task when you do bite the bullet and start upgrading.
Thanks for the insight. I went ahead with Virtualbox and Homestead. Downloaded latest for both (Virtualbox 7.x and whatever Homestead was.)
Fortunately it Just Worked (I've had issues in the past). The only thing that took me a little fiddling around was remembering how to configure Homestead. As well as figuring out that I needed to downgrade PHP for my project. Had to use 7.x. Which I set in Homestead.yaml. But also that when I ssh'd into vagrant I had to invoke php71 for artisan commands to work.
Looks like I got my local dev environment setup again on this new machine. I think I'll use Shift to aid me in upgrading the site to the recent version so that I'm not so far behind any longer.
I presume Homestead works with Laravel 10? Or is it all Sails going forward?
@thomthom Yeah, Homestead still works with Laravel 10. You can swap to Sail once you get to a recent version of Laravel if you want to use something Docker-based.
Hm. I got all the way to Laravel 9. Now I'm faced with PHP 8 requirement. Until now I have used the php7, php72, php73 commands to switch PHP versions when I ssh into vagrant/homestead. But there is no php8?