width = $width; if ($this->width == static::FULL_WIDTH) { $this->height = static::DYNAMIC_HEIGHT; } return $this; } /** * Set the height of a card to use a fixed value. * * @param string $height * @return $this */ public function height($height) { $this->height = $height; return $this; } /** * Set the height of a card to be dynamic. * * @return $this */ public function dynamicHeight() { $this->height = static::DYNAMIC_HEIGHT; return $this; } /** * Set the height of a card to be fixed. * * @return $this */ public function fixedHeight() { $this->height = static::FIXED_HEIGHT; return $this; } /** * Prepare the element for JSON serialization. * * @return array */ public function jsonSerialize(): array { return array_merge([ 'width' => $this->width, 'height' => $this->height, ], parent::jsonSerialize()); } }