Skip to content
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 database credentials support #353

Closed
wants to merge 5 commits into from

Conversation

CyberPunkCodes
Copy link

@CyberPunkCodes CyberPunkCodes commented Aug 14, 2024

The current installation process is a bit clunky. You have to create a database matching the Laravel application, it assumes your username should be root, and with no password.

This PR asks you during the CLI installation process for the database name, user, and password. Leaving blank will use the default values just as Laravel always has used.

It also supports passing the options to the command line via: dbname, dbuser, and dbpass

Screen Shot 2024-08-14 at 3 06 07 PM

I don't have all the databases setup. Is there a use case, ie: using one of the other database options other than MySQL, that we wouldn't want (or need) to ask the credential questions?

I would like to get some feedback to ensure this works how people would like it to work for the various database types.

@taylorotwell
Copy link
Member

Thanks for your pull request to Laravel!

Unfortunately, I'm going to delay merging this code for now. To preserve our ability to adequately maintain the framework, we need to be very careful regarding the amount of code we include.

If applicable, please consider releasing your code as a package so that the community can still take advantage of your contributions!

@CyberPunkCodes
Copy link
Author

@taylorotwell The current install process, at least for MySQL, is clunky. It assumes you want the database named the exact same as the project, it does not allow you to change the user from root, and it does not support a password. You can't run the migrations seamlessly through the installer process. You have to switch over to your editor and edit the .env file before running the migrations in the installer.

You can see some of the issue discussed here: https://laracasts.com/index.php/discuss/channels/laravel/how-to-create-a-new-laravel-project-when-the-root-password-is-not-empty

we need to be very careful regarding the amount of code we include

It's two small sections. One for dbuser and another for dbpass.

This is the last time I waste my time with PRs for anything laravel.

@snapey
Copy link

snapey commented Aug 15, 2024

How do you create a package to be included in the framework install process?

@antimech
Copy link

Personally, I'm fine with editing the .env file just before answering "yes" to the question "Would you like to run the default database migrations?".

@CyberPunkCodes
Copy link
Author

Personally, I'm fine with editing the .env file just before answering "yes" to the question "Would you like to run the default database migrations?".

Then what is the point of using a handy dandy installer? If you can't do what you need in the installer, then the installer is falling short.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants