@extends('layouts.admin') @section('content')

{{ __('Edit Machine') }}

{{ $machine->name }} / {{ $machine->serial_no }}

url($machine->images[0]) . "'" : 'null' }}, {{ isset($machine->images[1]) ? "'" . Storage::disk('public')->url($machine->images[1]) . "'" : 'null' }}, {{ isset($machine->images[2]) ? "'" . Storage::disk('public')->url($machine->images[2]) . "'" : 'null' }} ], removeImages: [false, false, false], handleImageUpload(event, index) { const file = event.target.files[0]; if (!file) return; const reader = new FileReader(); reader.onload = (e) => { this.imagePreviews[index] = e.target.result; this.removeImages[index] = false; }; reader.readAsDataURL(file); }, removeImage(index) { this.imagePreviews[index] = null; this.removeImages[index] = true; if (this.$refs['imageInput_' + index]) this.$refs['imageInput_' + index].value = ''; }, submitForm() { if (!this.$el.name.value.trim()) { window.dispatchEvent(new CustomEvent('toast', { detail: { message: '{{ __("Enter machine name") }}', type: 'error' } })); return; } if (!this.$el.serial_no.value.trim()) { window.dispatchEvent(new CustomEvent('toast', { detail: { message: '{{ __("Enter serial number") }}', type: 'error' } })); return; } if (!this.$el.machine_model_id.value.trim()) { window.dispatchEvent(new CustomEvent('toast', { detail: { message: '{{ __("Please select a machine model") }}', type: 'error' } })); return; } this.$el.submit(); } }" @submit.prevent="submitForm" action="{{ route('admin.basic-settings.machines.update', $machine) }}" method="POST" enctype="multipart/form-data" x-data="{ activeTab: 'basic' }" class="space-y-6"> @csrf @method('PUT') @if ($errors->any())

{{ __('Some fields need attention') }}

    @foreach ($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif

{{ __('Basic Information') }}

@foreach($models as $model) @endforeach
@if(auth()->user()->isSystemAdmin())
@foreach($companies as $company) @endforeach @error('company_id')

{{ $message }}

@enderror
@endif

{{ __('Operational Parameters') }}

@foreach($paymentConfigs as $config) @endforeach

{{ __('Hardware & Slots') }}

@foreach([['1-10', 'is_spring_slot_1_10'], ['11-20', 'is_spring_slot_11_20'], ['21-30', 'is_spring_slot_21_30'], ['31-40', 'is_spring_slot_31_40'], ['41-50', 'is_spring_slot_41_50'], ['51-60', 'is_spring_slot_51_60']] as $slot) @endforeach

{{ __('Machine System Settings') }}

{{ __('Electronic Invoice') }} {{ __('System-wide Invoice Support') }}
tax_invoice_enabled ? 'checked' : '' }} class="sr-only peer">

{{ __('Machine Images') }}

@for($i = 0; $i < 3; $i++)
{{ __('Photo Slot') }} {{ $i + 1 }}
@endfor

{{ __('PNG, JPG, WEBP up to 10MB') }}

@endsection @section('scripts') @endsection