apokryfos's comment got me thinking and I tried the following curl
command
curl -s "https://laravel.build/example-app?with=mysql&php=74" | bash
That worked. My composer.json looks like this
"require": {
"php": "^7.3|^8.0",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1",
"laravel/framework": "^8.75",
"laravel/sanctum": "^2.11",
"laravel/tinker": "^2.5"
},
... and with sail up
, I have a Laravel v8.83.9 up and running.
For some reason, the PHP version is still 8.1, but I can change the PHP version in the docker-compose.yml to PHP 7.4 and rebuild. With that, I have (PHP v7.4.28).
Update:
I originally thought adding a "laravel=8" to the curl
command would load laravel in version 8.x, but this had no effect. Adding php=74 is enough to get laravel in version 8.x, but it does not set PHP to version 7.4. That needs to be done in the docker-compose.yml file.