class ComponentSlot implements Htmlable, Stringable (View source)

Properties

ComponentAttributeBag $attributes

The slot attribute bag.

protected string $contents

The slot contents.

Methods

void
__construct(string $contents = '', array $attributes = [])

Create a new slot instance.

$this
withAttributes(array $attributes)

Set the extra attributes that the slot should make available.

string
toHtml()

Get the slot's HTML string.

bool
isEmpty()

Determine if the slot is empty.

bool
isNotEmpty()

Determine if the slot is not empty.

bool
hasActualContent(callable|string|null $callable = null)

Determine if the slot has non-comment content.

string
__toString()

Get the slot's HTML string.

Details

void __construct(string $contents = '', array $attributes = [])

Create a new slot instance.

Parameters

string $contents
array $attributes

Return Value

void

$this withAttributes(array $attributes)

Set the extra attributes that the slot should make available.

Parameters

array $attributes

Return Value

$this

string toHtml()

Get the slot's HTML string.

Return Value

string

bool isEmpty()

Determine if the slot is empty.

Return Value

bool

bool isNotEmpty()

Determine if the slot is not empty.

Return Value

bool

bool hasActualContent(callable|string|null $callable = null)

Determine if the slot has non-comment content.

Parameters

callable|string|null $callable

Return Value

bool

string __toString()

Get the slot's HTML string.

Return Value

string