*/ use HasFactory; /** * The resource name for this model when it is transformed into an * API representation using fractal. */ public const string RESOURCE_NAME = 'database_host'; /** * @return array */ protected function casts(): array { return [ 'id' => 'integer', 'max_databases' => 'integer', 'node_id' => 'integer', ]; } /** * Gets the node associated with a database host. * * @return BelongsTo */ public function node(): BelongsTo { return $this->belongsTo(Node::class); } /** * Gets the databases associated with this host. * * @return HasMany */ public function databases(): HasMany { return $this->hasMany(Database::class); } }