Skip to content

Commit 529b33b

Browse files
authored
Set laravel PHP default to 8.1, fixes ddev#4651 (ddev#4653)
1 parent 1552bf2 commit 529b33b

File tree

5 files changed

+18
-12
lines changed

5 files changed

+18
-12
lines changed

docs/content/users/quickstart.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ While the generic `php` project type is [ready to go](./project.md) with any CMS
201201
```bash
202202
mkdir my-laravel-app
203203
cd my-laravel-app
204-
ddev config --project-type=laravel --docroot=public --create-docroot
205-
ddev composer create --prefer-dist --no-install --no-scripts laravel/laravel
204+
ddev config --project-type=laravel --docroot=public --create-docroot --php-version=8.1
205+
ddev composer create --prefer-dist --no-install --no-scripts laravel/laravel -y
206206
ddev composer install
207207
ddev exec "php artisan key:generate"
208208
ddev launch
@@ -211,7 +211,7 @@ While the generic `php` project type is [ready to go](./project.md) with any CMS
211211
```bash
212212
git clone <your-laravel-repo>
213213
cd <your-laravel-project>
214-
ddev config --project-type=laravel --docroot=public --create-docroot
214+
ddev config --project-type=laravel --docroot=public --create-docroot --php-version=8.1
215215
ddev start
216216
ddev composer install
217217
ddev exec "php artisan key:generate"

pkg/ddevapp/apptypes.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func init() {
9393
},
9494

9595
nodeps.AppTypeLaravel: {
96-
appTypeDetect: isLaravelApp, postStartAction: laravelPostStartAction, configOverrideAction: nil,
96+
appTypeDetect: isLaravelApp, postStartAction: laravelPostStartAction, configOverrideAction: laravelConfigOverrideAction,
9797
},
9898

9999
nodeps.AppTypeMagento: {

pkg/ddevapp/apptypes_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func TestPostConfigAction(t *testing.T) {
6969
nodeps.AppTypeDrupal8: nodeps.PHP74,
7070
nodeps.AppTypeDrupal9: nodeps.PHPDefault,
7171
nodeps.AppTypeDrupal10: nodeps.PHP81,
72-
nodeps.AppTypeLaravel: nodeps.PHPDefault,
72+
nodeps.AppTypeLaravel: nodeps.PHP81,
7373
nodeps.AppTypeMagento: nodeps.PHP74,
7474
nodeps.AppTypeMagento2: nodeps.PHP81,
7575
nodeps.AppTypeWordPress: nodeps.PHPDefault,

pkg/ddevapp/ddevapp_test.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -179,18 +179,18 @@ var (
179179
// 9: laravel
180180
{
181181
Name: "TestPkgLaravel",
182-
SourceURL: "https://github.com/ddev/ddev_test_tarballs/releases/download/v1.1/ddev-lumen-testapp.tar.gz",
183-
ArchiveInternalExtractionPath: "ddev-lumen-testapp/",
182+
SourceURL: "https://github.com/ddev/test-laravel/archive/refs/tags/10.0.5.2.tar.gz",
183+
ArchiveInternalExtractionPath: "test-laravel-10.0.5.2/",
184184
FilesTarballURL: "",
185185
FilesZipballURL: "",
186-
DBTarURL: "https://github.com/ddev/ddev_test_tarballs/releases/download/v1.1/ddev-lumen-testapp_sql.tar.gz",
187-
DBZipURL: "https://github.com/ddev/ddev_test_tarballs/releases/download/v1.1/ddev-lumen-testapp_sql.zip",
186+
DBTarURL: "https://github.com/ddev/test-laravel/releases/download/10.0.5.2/db.sql.tar.gz",
187+
DBZipURL: "",
188188
FullSiteTarballURL: "",
189189
Type: nodeps.AppTypeLaravel,
190190
Docroot: "public",
191-
Safe200URIWithExpectation: testcommon.URIWithExpect{URI: "/", Expect: "Laravel Components"},
192-
DynamicURI: testcommon.URIWithExpect{URI: "/api/status-code/200", Expect: "indicates that the request has succeeded."},
193-
FilesImageURI: "/images/200.jpg",
191+
Safe200URIWithExpectation: testcommon.URIWithExpect{URI: "/static/", Expect: "This is a static HTML page"},
192+
DynamicURI: testcommon.URIWithExpect{URI: "/", Expect: "Second message"},
193+
FilesImageURI: "/static/sample-1.jpg",
194194
},
195195
// 10: shopware6
196196
{

pkg/ddevapp/laravel.go

+6
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,9 @@ func laravelPostStartAction(app *DdevApp) error {
6464

6565
return nil
6666
}
67+
68+
// laravelConfigOverrideAction overrides php_version for laravel, requires PHP8.1
69+
func laravelConfigOverrideAction(app *DdevApp) error {
70+
app.PHPVersion = nodeps.PHP81
71+
return nil
72+
}

0 commit comments

Comments
 (0)