Render Canvass forms using Laravel's Blade
Note: This library assumes your are including it in a Laravel project.
Install the library via composer:
composer require canvass/canvass-paint-blade
Within a route or controller, instantiate a RenderFunction
and pass it to the RenderForm
action
$action = new \CanvassPaint\Action\RenderForm(
new \CanvassPaint\Blade\RenderFunction()
);
$html = $action->render($form_id, $owner_id);
return view('canvass::preview.form', [
'form_html' => $html,
'form' => $form->getForm(),
]);