@php $page = $form->title; ($view_type === 'preview') and $page .= ' - Preview*'; $module = ($view_type === 'preview') ? 'My Form' : config('app.name'); $fields = $form->fields()->filled()->get(); @endphp @section('title', "{$module} | {$page}") @extends('layouts.auth') @section('content')
{{ $page }}
@if ($form->status === App\Form::STATUS_CLOSED && $view_type !== 'preview')
{{ optional($form->availability)->closed_form_message ?? 'Sorry, this form has been closed to responses.' }}
@else
{!! str_convert_line_breaks($form->description) !!}
@if ($view_type === 'form') @csrf @endif
@php $formatted_fields = []; @endphp @if ($fields->count()) {{--

Fields with * are required

--}} @foreach ($fields as $field) @php $template = get_form_templates($field->template) @endphp
{!! $template['main_template'] !!}
@php $only_attributes = ['attribute', 'template', 'question', 'required', 'options']; $formatted_fields[$field->attribute] = $field->only($only_attributes); @endphp @endforeach @endif
@endif
@endsection @if ($form->status === App\Form::STATUS_OPEN || $view_type === 'preview') @section('plugin-scripts') @endsection @section('page-script') @include('forms.partials._script-view') @endsection @endif