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 @@ -4,6 +4,7 @@

use ArrayAccess;
use ArrayIterator;
use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Contracts\Support\Htmlable;
use Illuminate\Support\Arr;
use Illuminate\Support\HtmlString;
Expand All @@ -14,7 +15,7 @@
use JsonSerializable;
use Traversable;

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

Expand Down Expand Up @@ -486,6 +487,16 @@ public function jsonSerialize(): mixed
return $this->attributes;
}

/**
* Convert the object into an array.
*
* @return array
*/
public function toArray()
{
return $this->attributes;
}

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