1 | <?php |
||
29 | class DatabaseServer extends Model |
||
30 | { |
||
31 | /** |
||
32 | * The table associated with the model. |
||
33 | * |
||
34 | * @var string |
||
35 | */ |
||
36 | protected $table = 'database_servers'; |
||
37 | |||
38 | /** |
||
39 | * The attributes excluded from the model's JSON form. |
||
40 | * |
||
41 | * @var array |
||
42 | */ |
||
43 | protected $hidden = ['password']; |
||
44 | |||
45 | /** |
||
46 | * Fields that are not mass assignable. |
||
47 | * |
||
48 | * @var array |
||
49 | */ |
||
50 | protected $guarded = ['id', 'created_at', 'updated_at']; |
||
51 | |||
52 | /** |
||
53 | * Cast values to correct type. |
||
54 | * |
||
55 | * @var array |
||
56 | */ |
||
57 | protected $casts = [ |
||
58 | 'id' => 'integer', |
||
59 | 'server_id' => 'integer', |
||
60 | 'db_server' => 'integer', |
||
61 | ]; |
||
62 | |||
63 | /** |
||
64 | * Gets the node associated with a database host. |
||
65 | * |
||
66 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
67 | */ |
||
68 | public function node() |
||
72 | |||
73 | /** |
||
74 | * Gets the databases assocaited with this host. |
||
75 | * |
||
76 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
77 | */ |
||
78 | public function databases() |
||
82 | } |
||
83 |