Body functions

setBody
getBody
addBodyAttribute
removeBodyAttribute
getBodyAttribute

setBody

Sets the response body content.
@param string $body The content for the response body
@return $this Fluent interface

setBody(string $body): self

getBody

Gets the current response body content.
@return string The response body content

getBody(): string

addBodyAttribute

Adds an attribute to the HTML body tag.
@param string $attribute Attribute name
@param string|array $value Attribute value or array of values
@return void

addBodyAttribute(string $attribute, string|array $value): void

Example:

$this->addBodyAttribute('data-turbo', 'false');

removeBodyAttribute

Removes an attribute from the HTML body tag.
@param string $attribute Attribute name
@return void

removeBodyAttribute(string $attribute): void

getBodyAttribute

Gets the value of a specific body attribute.
@param string $attribute Attribute name
@return string|array Value of the attribute

getBodyAttribute(string $attribute): string|array