Making changes to the setup screen

This commit is contained in:
James Brooks
2016-10-08 17:30:32 +01:00
parent 318227f067
commit 0371d86be0
3 changed files with 87 additions and 28 deletions

View File

@@ -64,6 +64,20 @@ class SetupController extends Controller
'log' => 'Log (Testing)',
];
/**
* Array of queue drivers.
*
* @var string[]
*/
protected $queueDrivers = [
"null" => "None",
"sync" => "Synchronous",
"database" => "Database",
"beanstalkd" => "Beanstalk",
"sqs" => "Amazon SQS",
"redis" => "Redis",
];
/**
* Array of step1 rules.
*
@@ -95,6 +109,7 @@ class SetupController extends Controller
$this->rulesStep1 = [
'env.cache_driver' => 'required|in:'.implode(',', array_keys($this->cacheDrivers)),
'env.session_driver' => 'required|in:'.implode(',', array_keys($this->cacheDrivers)),
'env.queue_driver' => 'required|in:'.implode(',', array_keys($this->queueDrivers)),
'env.mail_driver' => 'required|in:'.implode(',', array_keys($this->mailDrivers)),
];
@@ -132,12 +147,38 @@ class SetupController extends Controller
}
}
// Since .env may already be configured, we should show that data!
$cacheConfig = [
'driver' => Config::get('cache.default'),
];
$sessionConfig = [
'driver' => Config::get('session.driver'),
];
$queueConfig = [
'driver' => Config::get('queue.default'),
];
$mailConfig = [
'driver' => Config::get('mail.driver'),
'host' => Config::get('mail.host'),
'from' => Config::get('mail.from'),
'username' => Config::get('mail.username'),
'password' => Config::get('mail.password'),
];
return View::make('setup.index')
->withPageTitle(trans('setup.setup'))
->withCacheDrivers($this->cacheDrivers)
->withQueueDrivers($this->queueDrivers)
->withMailDrivers($this->mailDrivers)
->withUserLanguage($userLanguage)
->withAppUrl(Request::root());
->withAppUrl(Request::root())
->withCacheConfig($cacheConfig)
->withSessionConfig($sessionConfig)
->withQueueConfig($queueConfig)
->withMailConfig($mailConfig);
}
/**