@extends('admin.layouts.layouts') @section('title', 'Appointment Letter Template') @section('content')
{!! Form::open([ 'route' => 'appointment-letter.store', 'method' => 'POST', 'id' => 'template-form', 'class' => 'forms-sample', 'enctype' => 'multipart/form-data', ]) !!} @csrf {{ Form::hidden('id', $currentTemplate->id ?? '') }}
{!! Form::label('effective_date', 'Effective From', ['class' => 'form-label']) !!} * {!! Form::month( 'effective_date', old( 'effective_date', isset($currentTemplate?->effective_date) ? date('Y-m', strtotime($currentTemplate?->effective_date)) : '', ), [ 'class' => 'form-control', 'required' => true, 'data-parsley-required' => true, 'data-parsley-required-message' => 'Please select effective from', 'data-parsley-errors-container' => '#effective_date_error', ], ) !!}
{!! Form::label('template_content', 'Template Content', ['class' => 'form-label']) !!} * {!! Form::textarea('template_content', old('template_content', $currentTemplate?->description ?? ''), [ 'class' => 'form-control', 'rows' => 6, 'placeholder' => 'Enter Appointment Template Content', 'data-parsley-required' => true, 'data-parsley-trigger' => 'keyup', 'data-parsley-required-message' => 'Please enter appointment letter template content.', 'data-parsley-errors-container' => '#template_content_error', ]) !!} {{ $errors->first('template_content') }}
{{ Form::close() }}
Template History
@if ($templates->isEmpty())

Template records not found!

@else
@foreach ($templates as $template) @endforeach
Effective Month Created At Created By Updated At Updated By Actions
{{ date('F, Y', strtotime($template->effective_date)) }} {{ $template->created_at->format('d-m-Y') }} {{ $template->createdBy->name ?? '-' }} {{ isset($template->updated_at) ? $template->updated_at->format('d-m-Y') : '-' }} {{ isset($template->updated_at) ? $template->updatedBy->name : '-' }} @can('appointment-letter-template-view') @endcan
@endif
@endsection @section('page-js') @endsection