I have a blade component which can be used in blade files.
<x-my-component :inputOne="Hello" : inputTwo="Hi again"></x-my-component>
And for legacy reasons I would like to compile/translate it into html string so I could be used like that
$htmlComponentCode = Blade::compileComponent(
'<x-my-component :inputOne="Hello" : inputTwo="Hi again"></x-my-component>'
);
echo htmlComponentCode ;
And by echoing it out it will display the component same as it was included in a blade file.
I'm aware of this solution:
$html = (new MyComponent("Hello", "Hi again"))->render();
But I would prefer the on with html name.
Is something like that possible?