Add database host management to panel.
This commit is contained in:
parent
5bbded2c03
commit
198a021a97
12 changed files with 605 additions and 125 deletions
|
@ -43,11 +43,13 @@ class Database extends Model
|
|||
protected $hidden = ['password'];
|
||||
|
||||
/**
|
||||
* Fields that are not mass assignable.
|
||||
* Fields that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $guarded = ['id', 'created_at', 'updated_at'];
|
||||
protected $fillable = [
|
||||
'server_id', 'database_host_id', 'database', 'username', 'remote',
|
||||
];
|
||||
|
||||
/**
|
||||
* Cast values to correct type.
|
||||
|
@ -56,7 +58,7 @@ class Database extends Model
|
|||
*/
|
||||
protected $casts = [
|
||||
'server_id' => 'integer',
|
||||
'db_server' => 'integer',
|
||||
'database_host_id' => 'integer',
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -66,7 +68,7 @@ class Database extends Model
|
|||
*/
|
||||
public function host()
|
||||
{
|
||||
return $this->belongsTo(DatabaseServer::class, 'db_server');
|
||||
return $this->belongsTo(DatabaseHost::class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue