@extends('layouts.app')
@section('title', $customer->exists ? __('Edit Customer') : __('Add Customer'))
@section('content')
<form method="POST" action="{{ $customer->exists ? route('customers.update',$customer) : route('customers.store') }}">@csrf @if($customer->exists)@method('PUT')@endif<div class="card"><div class="card-body p-4"><div class="row g-3"><div class="col-md-6"><label class="form-label">{{ __('Full Name') }} *</label><input name="name" class="form-control" value="{{ old('name',$customer->name) }}" required></div><div class="col-md-3"><label class="form-label">{{ __('Phone') }}</label><input name="phone" class="form-control" value="{{ old('phone',$customer->phone) }}"></div><div class="col-md-3"><label class="form-label">{{ __('Type') }}</label><select name="type" class="form-select"><option value="retail" @selected(old('type',$customer->type)==='retail')>{{ __('Retail') }}</option><option value="wholesale" @selected(old('type',$customer->type)==='wholesale')>{{ __('Wholesale') }}</option></select></div><div class="col-md-6"><label class="form-label">Email</label><input type="email" name="email" class="form-control" value="{{ old('email',$customer->email) }}"></div><div class="col-md-3"><label class="form-label">{{ __('Credit Limit') }}</label><input name="credit_limit" type="number" step="0.01" class="form-control" value="{{ old('credit_limit',$customer->credit_limit ?? 0) }}"></div><div class="col-md-3"><label class="form-label">{{ __('Address') }}</label><input name="address" class="form-control" value="{{ old('address',$customer->address) }}"></div><div class="col-12"><label class="form-label">{{ __('Notes') }}</label><textarea name="notes" class="form-control" rows="3">{{ old('notes',$customer->notes) }}</textarea></div></div></div><div class="card-footer bg-white text-end"><a href="{{ route('customers.index') }}" class="btn btn-light">{{ __('Cancel') }}</a><button class="btn btn-success">{{ __('Save Customer') }}</button></div></div></form>
@endsection
