File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,7 @@ protected function getCasters()
104104 {
105105 $ casters = [
106106 'Illuminate\Support\Collection ' => 'Laravel\Tinker\TinkerCaster::castCollection ' ,
107+ 'Illuminate\Support\HtmlString ' => 'Laravel\Tinker\TinkerCaster::castHtmlString ' ,
107108 ];
108109
109110 if (class_exists ('Illuminate\Database\Eloquent\Model ' )) {
Original file line number Diff line number Diff line change @@ -68,6 +68,19 @@ public static function castCollection($collection)
6868 ];
6969 }
7070
71+ /**
72+ * Get an array representing the properties of an html string.
73+ *
74+ * @param \Illuminate\Support\HtmlString $htmlString
75+ * @return array
76+ */
77+ public static function castHtmlString ($ htmlString )
78+ {
79+ return [
80+ Caster::PREFIX_VIRTUAL .'html ' => $ htmlString ->toHtml (),
81+ ];
82+ }
83+
7184 /**
7285 * Get an array representing the properties of a model.
7386 *
You can’t perform that action at this time.
0 commit comments