Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/Illuminate/View/ComponentAttributeBag.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
use Illuminate\Support\Traits\Conditionable;
use Illuminate\Support\Traits\Macroable;
use IteratorAggregate;
use JsonSerializable;
use Traversable;

class ComponentAttributeBag implements ArrayAccess, Htmlable, IteratorAggregate
class ComponentAttributeBag implements ArrayAccess, IteratorAggregate, JsonSerializable, Htmlable
{
use Conditionable, Macroable;

Expand Down Expand Up @@ -455,6 +456,16 @@ public function getIterator(): Traversable
return new ArrayIterator($this->attributes);
}

/**
* Convert the object into a JSON serializable form.
*
* @return mixed
*/
public function jsonSerialize(): mixed
{
return $this->attributes;
}

/**
* Implode the attributes into a single HTML ready string.
*
Expand Down