{!! html()->form('PUT', route('unit.update', base64_encode($unit->id)))->id('unitForm')->open() !!}
{{-- Unit Name --}}
{!! html()->label('Unit Name *', 'unit_name')->toHtml() !!} {!! html()->text('unit_name')->class('form-control')->value(old('unit_name', $unit->unit_name))->placeholder('Enter Unit Name') !!}
{{-- Rated Capacity --}}
{!! html()->label('Rated Capacity *', 'unit_rated_capacity')->toHtml() !!} {!! html()->number('unit_rated_capacity')->class('form-control')->value(old('unit_rated_capacity', $unit->unit_rated_capacity))->placeholder('Enter Rated Capacity') !!}
{{-- UOM --}}
{!! html()->label('UOM *', 'unit_of_measure')->toHtml() !!} {!! html()->text('unit_of_measure')->class('form-control')->value(old('unit_of_measure', $unit->unit_of_measure))->placeholder('Enter UOM') !!}
{{-- Margin --}}
{!! html()->label('Margin *', 'margin_per_unit_of_capacity')->toHtml() !!} {!! html()->number('margin_per_unit_of_capacity')->class('form-control')->value(old('margin_per_unit_of_capacity', $unit->margin_per_unit_of_capacity))->placeholder('Enter Margin') !!}
{{-- Site --}}
{!! html()->label('Site *', 'master_site_id')->toHtml() !!} {!! html()->select('master_site_id', ['' => 'Select Site'] + $masterSites->toArray())->class('form-control')->value(old('master_site_id', $unit->master_site_id)) !!}
{{-- Created By --}}
{!! html()->label('Created By')->toHtml() !!} {!! html()->text('created_by')->class('form-control')->attribute('readonly', true)->value($unit->creator->full_name ?? 'N/A') !!}
{{-- Created At --}}
{!! html()->label('Created At')->toHtml() !!} {!! html()->text('created_at')->class('form-control')->attribute('readonly', true)->value(\Carbon\Carbon::parse($unit->created_at)->format(config('constants.date_format'))) !!}
{{-- Last Modified By --}}
{!! html()->label('Last Modified By')->toHtml() !!} {!! html()->text('last_modified_by')->class('form-control')->attribute('readonly', true)->value($unit->modifier->full_name ?? 'N/A') !!}
{{-- Last Modified At --}}
{!! html()->label('Last Modified At')->toHtml() !!} {!! html()->text('last_modified_at')->class('form-control')->attribute('readonly', true)->value(\Carbon\Carbon::parse($unit->updated_at)->format(config('constants.date_format'))) !!}
{!! html()->form()->close() !!}