%PDF- %PDF-
Direktori : /www/loslex/test/resources/views/ranges/ |
Current File : //www/loslex/test/resources/views/ranges/edit.blade.php |
<x-app-layout> <x-slot name="pagetitle">@isset($range) {{ __('Edit range details') . " - $range->name"}} @else {{ __('Add new range')}} @endisset</x-slot> <x-slot name="header"> <h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight"> @if (request()->routeIs('range.create')) {{ __('New range') }} @else {{ __('Edit range') }} @endif </h2> </x-slot> <form method="POST" action="{{ request()->routeIs('range.create') ? route('range.store') : route('range.update', ['range' => $range->id]) }}" class="space-y-6"> @csrf @if (request()->routeIs('range.edit')) @method('patch') @endif <div> <x-input-label for="name" :value="__('Range name')" /> <x-text-input id="name" name="name" type="text" class="mt-1 block w-full" :value="old('name', $range?->name)" /> <x-input-error class="mt-2" :messages="$errors->get('name')" /> </div> <div> <x-input-label class="inline" for="is_active" :value="__('Is active?')" /> <x-text-input id="is_active" name="is_active" type="checkbox" class="rounded ml-2" :checked="!empty(old('is_Active')) || (isset($range) && $range->is_active)" /> <x-input-error class="mt-2" :messages="$errors->get('is_active')" /> </div> <div> <x-input-label for="location" :value="__('Location')" /> <x-text-input id="location" name="location" type="text" class="mt-1 block w-full" :value="old('location', $range?->location)" /> <x-input-error class="mt-2" :messages="$errors->get('location')" /> </div> <div> <x-input-label for="region" :value="__('Region')" /> <x-select id="region" name="region" class="mt-1 block w-full"> @foreach (\App\Enums\RangeRegionEnum::cases() as $region) <option value="{{ $region->value }}" @selected(old('region', $range?->region) == $region->value)>{{ __('region.' . $region->name) }}</option> @endforeach </x-select> </div> <div> <x-input-label for="web" :value="__('Web')" /> <x-text-input id="web" name="web" type="text" class="mt-1 block w-full" :value="old('web', $range?->web)" /> <x-input-error class="mt-2" :messages="$errors->get('web')" /> </div> <div> <x-input-label for="email" :value="__('Email')" /> <x-text-input id="email" name="email" type="text" class="mt-1 block w-full" :value="old('email', $range?->email)" /> <x-input-error class="mt-2" :messages="$errors->get('email')" /> </div> <div> <x-input-label for="address" :value="__('Address')" /> <x-text-input id="address" name="address" type="text" class="mt-1 block w-full" :value="old('address', $range?->address)" /> <x-input-error class="mt-2" :messages="$errors->get('address')" /> </div> <div> <x-input-label for="phone" :value="__('Phone number')" /> <x-text-input id="phone" name="phone" type="text" class="mt-1 block w-full" :value="old('phone', $range?->phone)" /> <x-input-error class="mt-2" :messages="$errors->get('phone')" /> </div> <div> <x-input-label for="note" :value="__('Note')" /> <textarea placeholder="{{ __('Add note or keep empty') }}" x-data="{ resize() { $el.style.height = '3rem'; $el.style.height = 'calc(' + $el.scrollHeight + 'px + 1em)'; }}" x-init="$nextTick(resize)" x-on:input="resize" id="note" name="note" class="text-sm mt-1 border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 rounded-md shadow-sm w-full">{{ old('note', $range?->note) }}</textarea> <x-input-error class="mt-2" :messages="$errors->get('note')" /> </div> <div class="flex items-center gap-4 justify-end"><x-primary-button class="mr-4">{{ __('Save') }}</x-primary-button></div> </form> </x-app-layout>