Skip to content

List possible values for database driver #426

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

Merged
merged 2 commits into from
Jul 7, 2025

Conversation

dmarcoux
Copy link
Contributor

@dmarcoux dmarcoux commented Jul 6, 2025

Nobody has to guess anymore what the possible values are for the --database option.

Nobody has to guess anymore what the possible values are for the
--database option.
if ($input->getOption('database') && ! in_array($input->getOption('database'), $drivers = ['mysql', 'mariadb', 'pgsql', 'sqlite', 'sqlsrv'])) {
throw new \InvalidArgumentException("Invalid database driver [{$input->getOption('database')}]. Valid options are: ".implode(', ', $drivers).'.');
if ($input->getOption('database') && ! in_array($input->getOption('database'), self::DATABASE_DRIVERS)) {
throw new \InvalidArgumentException("Invalid database driver [{$input->getOption('database')}]. Possible values are: ".implode(', ', self::DATABASE_DRIVERS).'.');
Copy link
Contributor Author

@dmarcoux dmarcoux Jul 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are validating the --database option here, but what the users provide is a value for that option. This is why I've changed the text to better reflect this.

@taylorotwell taylorotwell merged commit ba65cc5 into laravel:master Jul 7, 2025
11 of 18 checks passed
@dmarcoux dmarcoux deleted the new_database_possible_values branch July 7, 2025 18:14
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.

2 participants