Support for hostnames in database connection field.

This commit is contained in:
Dane Everitt 2016-11-26 20:27:36 -05:00
parent c107dbfa74
commit f6275058d0
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53

View file

@ -231,6 +231,11 @@ class DatabaseRepository {
*/
public function add(array $data)
{
if (isset($data['host'])) {
$data['host'] = gethostbyname($data['host']);
}
$validator = Validator::make($data, [
'name' => 'required|string|max:255',
'host' => 'required|ip|unique:database_servers,host',