@php $employeeConveyances = isset($currentConveyance->employeeConveyances) ? $currentConveyance->employeeConveyances->keyBy('employee_id') : collect(); @endphp @extends('admin.layouts.layouts') @section('title', 'Conveyance Master') @section('page-css') @endsection @section('content') @if (count($employees) > 0)
{!! Form::open([ 'route' => 'conveyance-master.store', 'method' => 'POST', 'id' => 'conveyance-form', 'enctype' => 'multipart/form-data', ]) !!} @csrf
{!! Form::label('effective_from', 'Effective From', ['class' => 'form-label']) !!} * {!! Form::month( 'effective_from', old( 'effective_from', isset($currentConveyance?->effective_from) ? date('Y-m', strtotime($currentConveyance?->effective_from)) : null, ), [ 'class' => 'form-control', 'data-parsley-required' => true, 'data-parsley-required-message' => 'Please select effective from date.', ], ) !!}
@foreach ($employees as $employee) @endforeach
Sr Employee Code Conveyance Type Amount
{{ $loop->iteration }} {{ $employee->employee_name ?? '' }} ({{ $employee->employeeDesignation->name ?? '' }}) {{ $employee->employee_code ?? '' }} {!! Form::select( 'conveyance_type[' . $employee->id . ']', ['Daily' => 'Daily', 'Monthly' => 'Monthly'], optional($employeeConveyances->get($employee->id))->conveyance_type ?? null, [ 'class' => 'form-control form-control-sm', 'placeholder' => 'Select Type', 'data-employee-id' => $employee->id, 'data-parsley-required' => 'true', 'data-parsley-required-message' => 'Please select conveyance type.', ], ) !!} {!! Form::text( 'amount[' . $employee->id . ']', optional($employeeConveyances->get($employee->id))->amount ?? 0, [ 'class' => 'form-control amount', 'placeholder' => 'Enter Conveyance Amount', 'data-parsley-required' => 'true', 'data-parsley-required-message' => 'Please enter conveyance amount.', ], ) !!}
{{ Form::close() }}
@endif
Conveyance History
@if ($conveyances->isEmpty())

Records not found!

@else
@foreach ($conveyances as $conveyance) @endforeach
Effective Month Created At Created By Updated At Updated By Actions
{{ date('F Y', strtotime($conveyance->effective_from)) }} {{ $conveyance->created_at->format('d-m-Y h:i:s A') }} {{ $conveyance->createdBy->name ?? '-' }} {{ !empty($conveyance->updated_at) ? $conveyance->updated_at->format('d-m-Y h:i:s A') : '-' }} {{ !empty($conveyance->updated_at) ? $conveyance->updatedBy->name ?? '-' : '-' }}
@endif
@endsection @section('page-js') @endsection