Don't resolve database hosts; closes #2237
This commit is contained in:
parent
61e9771333
commit
540cc82e3d
4 changed files with 64 additions and 6 deletions
|
@ -2,6 +2,8 @@
|
|||
|
||||
namespace Pterodactyl\Models;
|
||||
|
||||
use Pterodactyl\Rules\ResolvesToIPAddress;
|
||||
|
||||
class DatabaseHost extends Model
|
||||
{
|
||||
/**
|
||||
|
@ -51,13 +53,25 @@ class DatabaseHost extends Model
|
|||
*/
|
||||
public static $validationRules = [
|
||||
'name' => 'required|string|max:255',
|
||||
'host' => 'required|unique:database_hosts,host',
|
||||
'host' => 'required|string',
|
||||
'port' => 'required|numeric|between:1,65535',
|
||||
'username' => 'required|string|max:32',
|
||||
'password' => 'nullable|string',
|
||||
'node_id' => 'sometimes|nullable|integer|exists:nodes,id',
|
||||
];
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public static function getRules()
|
||||
{
|
||||
$rules = parent::getRules();
|
||||
|
||||
$rules['host'] = array_merge($rules['host'], [ new ResolvesToIPAddress() ]);
|
||||
|
||||
return $rules;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the node associated with a database host.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue