ddev
ddev copied to clipboard
automate Laravel settings
The Problem/Issue/Bug:
Laravel setup with DDEV can/should be automated.
How this PR Solves The Problem:
Add an additional command to set
- APP_URL
- DB_HOST
- DB_DATABASE / DB_USERNAME / DB_PASSWORD
- DB_CONNECTION
- DB_PORT
Manual Testing Instructions:
Run ddev laravel on a laravel project
- test without an
.env - test with an existing
.env
Automated Testing Overview:
TODO
- [ ] Get and update
DB_TYPEfrom DDEV (not sure how to get this) - [ ] Get and update
DB_PORTfrom DDEV (not sure how to get this) - [ ] Add to post-config hook for Laravel projects?
- [ ] Add meaningful tests
Related Issue Link(s):
Fixes #3636 https://github.com/drud/ddev/issues/3636
Download the artifacts for this pull request:
How about doing this in the actual code? https://github.com/drud/ddev/blob/master/pkg/ddevapp/laravel.go
In current DDEV head there's a DDEV_DATABASE like DDEV_DATABASE=mariadb:10.3
The DB Port is always the default for the db type.
I'm thinking this might be best to start life as a collection of laravel extras? Maybe tyler36/ddev-laravel-extras? I think it should have a better name than "laravel" though.
But I do think we should figure out better laravel-specific settings file management in ddev itself.
Originally, it was named 'quick', as in 'quick start'.
The idea was each supported project-type would have a corresponding 'quick' (determined by project-type). This would basically run the post-install style hooks. This PR demonstrates a 'laravel' project type, setting the env & running key:generate; Drupal , would be the settings.ddev.php etc.
Custom command for post-install has some benefits:
- allows me to have a global, or project level laravel setup
- allows me to "reset" a project by re-running the command
As you said, we don't have good Laravel post-install support out of the box. We prompt users to run several commands which is less than ideal. This is the beginning of that talk.
Oh, I guess you actually started the conversation in
- https://github.com/drud/ddev/issues/3636
IMO this should be done in laravel.go, automatically. Closing for now, happy to continue the conversation here or elsewhere.
IMO this should be done in laravel.go, automatically. Closing for now, happy to continue the conversation here or elsewhere.
Agreed. In a new action on the project type I think. We're facing the same issue in our Craft CMS project type PR