Add ability to preview application
This commit is contained in:
@@ -87,7 +87,7 @@ class FormController extends Controller
|
||||
{
|
||||
$deletable = false;
|
||||
}
|
||||
|
||||
|
||||
if ($deletable)
|
||||
{
|
||||
$form->delete();
|
||||
@@ -103,4 +103,11 @@ class FormController extends Controller
|
||||
|
||||
}
|
||||
|
||||
public function preview(Request $request, Form $form)
|
||||
{
|
||||
return view('dashboard.administration.formpreview')
|
||||
->with('form', json_decode($form->formStructure, true))
|
||||
->with('title', $form->formName);
|
||||
}
|
||||
|
||||
}
|
||||
|
33
app/View/Components/Form.php
Normal file
33
app/View/Components/Form.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components;
|
||||
|
||||
use Illuminate\View\Component;
|
||||
|
||||
class Form extends Component
|
||||
{
|
||||
|
||||
public $formFields;
|
||||
|
||||
|
||||
public $disableFields = false;
|
||||
/**
|
||||
* Create a new component instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($disableFields = false)
|
||||
{
|
||||
$this->disableFields = $disableFields;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*
|
||||
* @return \Illuminate\View\View|string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
return view('components.form');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user