New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Laravel support #2249
Add Laravel support #2249
Conversation
Yay! |
4039f9e
to
e339ca4
Compare
@NBZ4live I took the liberty of rebasing this, so you'll need to update your local branch against the github fork. Hope that's OK. But I know you were concerned about the broken Windows container test. I also pushed a branch-specific version of ddev-webserver and added that into version.go, so you should be able to use your built ddev as is. |
Looks like you're right on track here. The key thing that needs to be added is a set of data to test against, as in https://github.com/drud/ddev/blob/f6e43e080196e5ade4f1e8f878d3bf3645878457/pkg/ddevapp/ddevapp_test.go#L41-L166 |
Yes, I know. As I wrote in the PR, I will need to write an app because I think that taking something random from GitHub doesn't feel to be right. But I will be able to do this only on the weekend. |
Ah, thanks. I didn't understand the context of your comment about "writing an app", had thought you were going to do more go test writing than was necessary. However, just simple codebase built with There's no rush, this will take some time to get in anyway. |
This would give test urls, but would not give a proper dbimport test |
Yes, agreed. It's best to have real URLs that depend on a matching database. |
f406f40
to
4a878b8
Compare
I'll be back to review this hopefully in the next week. It will also have to get moved probably to a new repo (drud/ddev-images), but I can take care of that. |
968215e
to
4a47493
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked this over and took a pass through at manual testing and everything worked great, including apptype detection and everything else.
I rebased this and pushed the latest version of the web image.
Thanks so much for a great contribution, and looking forward to having this in the next alpha release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NBZ4live there may be a problem with the nginx config. When going through the backpack demo I happened into the pages (/admin/page) and all of them are 404, even if I edit them and stuff. Is that a problem with the nginx config?
(Note that I rebased again, so you'll need to reset to the branch). I had been hoping to pull this, but want you to check that situation first.)
…e to pass the test
…lesTarballURL, FilesZipballURL and FullSiteTarballURL are provided
…rtAction additionally to DB_HOST
4a47493
to
3367c74
Compare
To be more specific, here's the pages admin at http://laravel-backpack-demo.ddev.site/admin/page: If I click where the arrow is, it takes me to http://laravel-backpack-demo.ddev.site/mollitia, which is a 404. If I go to News->Articles, I'm able to preview the items there, but don't actually know how to see if they're really published or if the published URL works. |
@NBZ4live confirmed in slack that the behavior here is correct. |
The Problem/Issue/Bug:
There is currently no official Laravel support in form of a project-type.
https://github.com/drud/ddev-contrib/tree/master/recipes/laravel suggests to use the generic
php
project type, but it's Nginx config is more Drupal inspired than generic (for example thetry_files $uri $uri/ /index.php?q=$uri&$args;
)How this PR Solves The Problem:
This PR does add the
laravel
project type and official Laravel config for Nginx.Additionally, in the
postStartAction
, it does check if the the ddev db container is configured in the .env and prints some helpful instructions how to do it with a one-liner.Manual Testing Instructions:
How I tested:
Automated Testing Overview:
Will add some demo app to ddevapp_test.go later. Will probably need to write one, because using some random demo app from GitHub for this purpose does feel wrong.
Related Issue Link(s):
#898, #2084
Release/Deployment notes:
No. This should not affect any other project types
PS: I did add a wrapper for artisan (Laravel's cli), but decided to do this in a separate branch, because it's first time I do something in Go and I need to study the codebase a bit more to be able to make a test for it. (And at the moment I have no idea how to test the wrapper for a command which does exist only inside a Laravel project codebase)