本文整理汇总了PHP中Illuminate\Console\Command::askWithCompletion方法的典型用法代码示例。如果您正苦于以下问题:PHP Command::askWithCompletion方法的具体用法?PHP Command::askWithCompletion怎么用?PHP Command::askWithCompletion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Console\Command
的用法示例。
在下文中一共展示了Command::askWithCompletion方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle
/**
* Handle the command.
*/
public function handle()
{
$this->data->put('DB_DRIVER', $this->command->askWithCompletion('What database driver would you like to use? [mysql, pgsql, sqlite, sqlsrv]', ['mysql', 'pgsql', 'sqlite', 'sqlsrv'], env('DB_DRIVER', 'mysql')));
$this->data->put('DB_HOST', $this->command->ask('What is the hostname of your database?', env('DB_HOST', 'localhost')));
$this->data->put('DB_DATABASE', $this->command->ask('What is the name of your database?', env('DB_DATABASE')));
$this->data->put('DB_USERNAME', $this->command->ask('Enter the username for your database connection', env('DB_USERNAME', 'root')));
$this->data->put('DB_PASSWORD', $this->command->ask('Enter the password for your database connection', env('DB_PASSWORD')));
}
示例2: handle
/**
* Handle the command.
*
* @param Repository $config
*/
public function handle(Repository $config)
{
$this->data->put('LOCALE', $this->command->askWithCompletion('Enter the default locale', array_keys($config->get('streams::locales.supported')), env('APPLICATION_LOCALE', 'en')));
$this->data->put('TIMEZONE', $this->command->askWithCompletion('Enter the default timezone', timezone_identifiers_list(), env('APPLICATION_TIMEZONE', 'UTC')));
return $this->data;
}