Skip to content

Commit 290281b

Browse files
committed
Implement Htmlable
1 parent b6456bd commit 290281b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Elements/Element.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
namespace Galahad\Forms\Elements;
44

5+
use Illuminate\Contracts\Support\Htmlable;
6+
57
/**
68
*
79
*/
8-
abstract class Element
10+
abstract class Element implements Htmlable
911
{
1012
/** @var array */
1113
protected $attributes = [];
@@ -140,6 +142,11 @@ public function __toString()
140142
return $this->render();
141143
}
142144

145+
public function toHtml()
146+
{
147+
return $this->render();
148+
}
149+
143150
/**
144151
* $element->foo('bar') -> $element->attribute('foo', 'bar')
145152
* $element->foo() -> $element->attribute('foo', 'foo')

0 commit comments

Comments
 (0)