Address And Profile Edit Request Validated
This commit is contained in:
parent
2e98a6f077
commit
160426cedb
|
|
@ -2,23 +2,27 @@
|
|||
|
||||
namespace Webkul\Customer\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Webkul\Customer\Http\Requests\CustomerAddressRequest;
|
||||
use Webkul\Customer\Repositories\CustomerAddressRepository;
|
||||
use Webkul\Customer\Rules\VatIdRule;
|
||||
use Auth;
|
||||
|
||||
class AddressController extends Controller
|
||||
{
|
||||
/**
|
||||
* Contains route related configuration
|
||||
* Contains route related configuration.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_config;
|
||||
|
||||
/**
|
||||
* CustomerAddressRepository object
|
||||
* Current customer.
|
||||
*
|
||||
* @var \Webkul\Customer\Models\Customer
|
||||
*/
|
||||
protected $customer;
|
||||
|
||||
/**
|
||||
* Customer address repository instance.
|
||||
*
|
||||
* @var \Webkul\Customer\Repositories\CustomerAddressRepository
|
||||
*/
|
||||
|
|
@ -36,13 +40,13 @@ class AddressController extends Controller
|
|||
|
||||
$this->_config = request('_config');
|
||||
|
||||
$this->customerAddressRepository = $customerAddressRepository;
|
||||
|
||||
$this->customer = auth()->guard('customer')->user();
|
||||
|
||||
$this->customerAddressRepository = $customerAddressRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address Route index page
|
||||
* Address route index page.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
|
|
@ -52,7 +56,7 @@ class AddressController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Show the address create form
|
||||
* Show the address create form.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
|
|
@ -68,29 +72,12 @@ class AddressController extends Controller
|
|||
*
|
||||
* @return view
|
||||
*/
|
||||
public function store()
|
||||
public function store(CustomerAddressRequest $request)
|
||||
{
|
||||
request()->merge(['address1' => implode(PHP_EOL, array_filter(request()->input('address1')))]);
|
||||
$data = $request->validated();
|
||||
|
||||
$data = collect(request()->input())->except('_token')->toArray();
|
||||
|
||||
$this->validate(request(), [
|
||||
'company_name' => 'string',
|
||||
'first_name' => 'string|required',
|
||||
'last_name' => 'string|required',
|
||||
'address1' => 'string|required',
|
||||
'country' => 'string|required',
|
||||
'state' => 'string|required',
|
||||
'city' => 'string|required',
|
||||
'postcode' => 'required',
|
||||
'phone' => 'required',
|
||||
'vat_id' => new VatIdRule(),
|
||||
]);
|
||||
|
||||
$cust_id['customer_id'] = $this->customer->id;
|
||||
$cust_id['first_name'] = $this->customer->first_name;
|
||||
$cust_id['last_name'] = $this->customer->last_name;
|
||||
$data = array_merge($cust_id, $data);
|
||||
$data['customer_id'] = $this->customer->id;
|
||||
$data['address1'] = implode(PHP_EOL, array_filter(request()->input('address1')));
|
||||
|
||||
if ($this->customer->addresses->count() == 0) {
|
||||
$data['default_address'] = 1;
|
||||
|
|
@ -100,15 +87,15 @@ class AddressController extends Controller
|
|||
session()->flash('success', trans('shop::app.customer.account.address.create.success'));
|
||||
|
||||
return redirect()->route($this->_config['redirect']);
|
||||
} else {
|
||||
session()->flash('error', trans('shop::app.customer.account.address.create.error'));
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
session()->flash('error', trans('shop::app.customer.account.address.create.error'));
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
/**
|
||||
* For editing the existing addresses of current logged in customer
|
||||
* For editing the existing addresses of current logged in customer.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
|
|
@ -116,7 +103,7 @@ class AddressController extends Controller
|
|||
{
|
||||
$address = $this->customerAddressRepository->findOneWhere([
|
||||
'id' => $id,
|
||||
'customer_id' => auth()->guard('customer')->user()->id,
|
||||
'customer_id' => $this->customer->id,
|
||||
]);
|
||||
|
||||
if (! $address) {
|
||||
|
|
@ -124,7 +111,7 @@ class AddressController extends Controller
|
|||
}
|
||||
|
||||
return view($this->_config['view'], array_merge(compact('address'), [
|
||||
'defaultCountry' => config('app.default_country')
|
||||
'defaultCountry' => config('app.default_country'),
|
||||
]));
|
||||
}
|
||||
|
||||
|
|
@ -134,24 +121,11 @@ class AddressController extends Controller
|
|||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update($id)
|
||||
public function update($id, CustomerAddressRequest $request)
|
||||
{
|
||||
request()->merge(['address1' => implode(PHP_EOL, array_filter(request()->input('address1')))]);
|
||||
$data = $request->validated();
|
||||
|
||||
$this->validate(request(), [
|
||||
'company_name' => 'string',
|
||||
'first_name' => 'string|required',
|
||||
'last_name' => 'string|required',
|
||||
'address1' => 'string|required',
|
||||
'country' => 'string|required',
|
||||
'state' => 'string|required',
|
||||
'city' => 'string|required',
|
||||
'postcode' => 'required',
|
||||
'phone' => 'required',
|
||||
'vat_id' => new VatIdRule(),
|
||||
]);
|
||||
|
||||
$data = collect(request()->input())->except('_token')->toArray();
|
||||
$data['address1'] = implode(PHP_EOL, array_filter(request()->input('address1')));
|
||||
|
||||
$addresses = $this->customer->addresses;
|
||||
|
||||
|
|
@ -172,7 +146,7 @@ class AddressController extends Controller
|
|||
|
||||
/**
|
||||
* To change the default address or make the default address,
|
||||
* by default when first address is created will be the default address
|
||||
* by default when first address is created will be the default address.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
|
|
@ -192,7 +166,7 @@ class AddressController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Delete address of the current customer
|
||||
* Delete address of the current customer.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
|
|
@ -201,7 +175,7 @@ class AddressController extends Controller
|
|||
{
|
||||
$address = $this->customerAddressRepository->findOneWhere([
|
||||
'id' => $id,
|
||||
'customer_id' => auth()->guard('customer')->user()->id,
|
||||
'customer_id' => $this->customer->id,
|
||||
]);
|
||||
|
||||
if (! $address) {
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ namespace Webkul\Customer\Http\Controllers;
|
|||
use Hash;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Webkul\Core\Contracts\Validations\AlphaNumericSpace;
|
||||
use Webkul\Core\Repositories\SubscribersListRepository;
|
||||
use Webkul\Customer\Http\Requests\CustomerProfileRequest;
|
||||
use Webkul\Customer\Repositories\CustomerRepository;
|
||||
use Webkul\Product\Repositories\ProductReviewRepository;
|
||||
use Webkul\Shop\Mail\SubscriptionEmail;
|
||||
|
|
@ -94,33 +94,20 @@ class CustomerController extends Controller
|
|||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update()
|
||||
public function update(CustomerProfileRequest $customerProfileRequest)
|
||||
{
|
||||
$isPasswordChanged = false;
|
||||
$id = auth()->guard('customer')->user()->id;
|
||||
|
||||
$this->validate(request(), [
|
||||
'first_name' => ['required', new AlphaNumericSpace],
|
||||
'last_name' => ['required', new AlphaNumericSpace],
|
||||
'gender' => 'required|in:Other,Male,Female',
|
||||
'date_of_birth' => 'date|before:today',
|
||||
'email' => 'email|unique:customers,email,' . $id,
|
||||
'password' => 'confirmed|min:6|required_with:oldpassword',
|
||||
'oldpassword' => 'required_with:password',
|
||||
'password_confirmation' => 'required_with:password',
|
||||
'image.*' => 'mimes:bmp,jpeg,jpg,png,webp'
|
||||
]);
|
||||
$data = $customerProfileRequest->validated();
|
||||
|
||||
$data = collect(request()->input())->except('_token')->toArray();
|
||||
|
||||
if (isset($data['date_of_birth']) && $data['date_of_birth'] == "") {
|
||||
if (isset($data['date_of_birth']) && $data['date_of_birth'] == '') {
|
||||
unset($data['date_of_birth']);
|
||||
}
|
||||
|
||||
$data['subscribed_to_news_letter'] = isset($data['subscribed_to_news_letter']) ? 1 : 0;
|
||||
|
||||
if (isset($data['oldpassword'])) {
|
||||
if ($data['oldpassword'] != "" || $data['oldpassword'] != null) {
|
||||
if ($data['oldpassword'] != '' || $data['oldpassword'] != null) {
|
||||
if (Hash::check($data['oldpassword'], auth()->guard('customer')->user()->password)) {
|
||||
$isPasswordChanged = true;
|
||||
|
||||
|
|
@ -137,7 +124,7 @@ class CustomerController extends Controller
|
|||
|
||||
Event::dispatch('customer.update.before');
|
||||
|
||||
if ($customer = $this->customerRepository->update($data, $id)) {
|
||||
if ($customer = $this->customerRepository->update($data, auth()->guard('customer')->user()->id)) {
|
||||
if ($isPasswordChanged) {
|
||||
Event::dispatch('user.admin.update-password', $customer);
|
||||
}
|
||||
|
|
@ -182,14 +169,14 @@ class CustomerController extends Controller
|
|||
|
||||
$this->customerRepository->uploadImages($data, $customer);
|
||||
|
||||
Session()->flash('success', trans('shop::app.customer.account.profile.edit-success'));
|
||||
session()->flash('success', trans('shop::app.customer.account.profile.edit-success'));
|
||||
|
||||
return redirect()->route($this->_config['redirect']);
|
||||
} else {
|
||||
Session()->flash('success', trans('shop::app.customer.account.profile.edit-fail'));
|
||||
|
||||
return redirect()->back($this->_config['redirect']);
|
||||
}
|
||||
|
||||
session()->flash('success', trans('shop::app.customer.account.profile.edit-fail'));
|
||||
|
||||
return redirect()->back($this->_config['redirect']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Customer\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Webkul\Core\Contracts\Validations\AlphaNumericSpace;
|
||||
use Webkul\Customer\Rules\VatIdRule;
|
||||
|
||||
class CustomerAddressRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'company_name' => [new AlphaNumericSpace],
|
||||
'first_name' => ['required', new AlphaNumericSpace],
|
||||
'last_name' => ['required', new AlphaNumericSpace],
|
||||
'address1' => ['required', 'array'],
|
||||
'address1.*' => ['required', new AlphaNumericSpace],
|
||||
'country' => ['required', 'alpha'],
|
||||
'state' => ['required', 'alpha'],
|
||||
'city' => ['required', new AlphaNumericSpace],
|
||||
'postcode' => ['required', 'numeric'],
|
||||
'phone' => ['required', 'numeric'],
|
||||
'vat_id' => [new VatIdRule()],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Customer\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Webkul\Core\Contracts\Validations\AlphaNumericSpace;
|
||||
|
||||
class CustomerProfileRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
$id = auth()->guard('customer')->user()->id;
|
||||
|
||||
return [
|
||||
'first_name' => ['required', new AlphaNumericSpace],
|
||||
'last_name' => ['required', new AlphaNumericSpace],
|
||||
'gender' => 'required|in:Other,Male,Female',
|
||||
'date_of_birth' => 'date|before:today',
|
||||
'email' => 'email|unique:customers,email,' . $id,
|
||||
'password' => 'confirmed|min:6|required_with:oldpassword',
|
||||
'oldpassword' => 'required_with:password',
|
||||
'password_confirmation' => 'required_with:password',
|
||||
'image.*' => 'mimes:bmp,jpeg,jpg,png,webp',
|
||||
'phone' => 'numeric',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -16,7 +16,6 @@
|
|||
{!! view_render_event('bagisto.shop.customers.account.address.create.before') !!}
|
||||
|
||||
<form method="post" action="{{ route('customer.address.store') }}" @submit.prevent="onSubmit">
|
||||
|
||||
<div class="account-table-content">
|
||||
@csrf
|
||||
|
||||
|
|
@ -24,7 +23,9 @@
|
|||
|
||||
<div class="control-group" :class="[errors.has('company_name') ? 'has-error' : '']">
|
||||
<label for="company_name">{{ __('shop::app.customer.account.address.create.company_name') }}</label>
|
||||
|
||||
<input type="text" class="control" name="company_name" value="{{ old('company_name') }}" data-vv-as=""{{ __('shop::app.customer.account.address.create.company_name') }}"">
|
||||
|
||||
<span class="control-error" v-if="errors.has('company_name')" v-text="errors.first('company_name')"></span>
|
||||
</div>
|
||||
|
||||
|
|
@ -32,7 +33,9 @@
|
|||
|
||||
<div class="control-group" :class="[errors.has('first_name') ? 'has-error' : '']">
|
||||
<label for="first_name" class="mandatory">{{ __('shop::app.customer.account.address.create.first_name') }}</label>
|
||||
|
||||
<input type="text" class="control" name="first_name" value="{{ old('first_name') ?? $currentCustomer->first_name }}" v-validate="'required'" data-vv-as=""{{ __('shop::app.customer.account.address.create.first_name') }}"">
|
||||
|
||||
<span class="control-error" v-if="errors.has('first_name')" v-text="errors.first('first_name')"></span>
|
||||
</div>
|
||||
|
||||
|
|
@ -40,7 +43,9 @@
|
|||
|
||||
<div class="control-group" :class="[errors.has('last_name') ? 'has-error' : '']">
|
||||
<label for="last_name" class="mandatory">{{ __('shop::app.customer.account.address.create.last_name') }}</label>
|
||||
|
||||
<input type="text" class="control" name="last_name" value="{{ old('last_name') ?? $currentCustomer->last_name }}" v-validate="'required'" data-vv-as=""{{ __('shop::app.customer.account.address.create.last_name') }}"">
|
||||
|
||||
<span class="control-error" v-if="errors.has('last_name')" v-text="errors.first('last_name')"></span>
|
||||
</div>
|
||||
|
||||
|
|
@ -50,19 +55,23 @@
|
|||
<label for="vat_id">{{ __('shop::app.customer.account.address.create.vat_id') }}
|
||||
<span class="help-note">{{ __('shop::app.customer.account.address.create.vat_help_note') }}</span>
|
||||
</label>
|
||||
|
||||
<input type="text" class="control" name="vat_id" value="{{ old('vat_id') }}" v-validate="" data-vv-as=""{{ __('shop::app.customer.account.address.create.vat_id') }}"">
|
||||
|
||||
<span class="control-error" v-if="errors.has('vat_id')" v-text="errors.first('vat_id')"></span>
|
||||
</div>
|
||||
|
||||
{!! view_render_event('bagisto.shop.customers.account.address.create_form_controls.vat_id.after') !!}
|
||||
|
||||
@php
|
||||
$addresses = explode(PHP_EOL, (old('address1') ?? ''));
|
||||
$addresses = old('address1') ?? explode(PHP_EOL, '');
|
||||
@endphp
|
||||
|
||||
<div class="control-group" :class="[errors.has('address1[]') ? 'has-error' : '']">
|
||||
<label for="address_0" class="mandatory">{{ __('shop::app.customer.account.address.create.street-address') }}</label>
|
||||
|
||||
<input type="text" class="control" name="address1[]" id="address_0" value="{{ $addresses[0] ?: '' }}" v-validate="'required'" data-vv-as=""{{ __('shop::app.customer.account.address.create.street-address') }}"">
|
||||
|
||||
<span class="control-error" v-if="errors.has('address1[]')" v-text="errors.first('address1[]')"></span>
|
||||
</div>
|
||||
|
||||
|
|
@ -82,7 +91,9 @@
|
|||
|
||||
<div class="control-group" :class="[errors.has('city') ? 'has-error' : '']">
|
||||
<label for="city" class="mandatory">{{ __('shop::app.customer.account.address.create.city') }}</label>
|
||||
|
||||
<input type="text" class="control" name="city" value="{{ old('city') }}" v-validate="'required'" data-vv-as=""{{ __('shop::app.customer.account.address.create.city') }}"">
|
||||
|
||||
<span class="control-error" v-if="errors.has('city')" v-text="errors.first('city')"></span>
|
||||
</div>
|
||||
|
||||
|
|
@ -90,7 +101,9 @@
|
|||
|
||||
<div class="control-group" :class="[errors.has('postcode') ? 'has-error' : '']">
|
||||
<label for="postcode" class="mandatory">{{ __('shop::app.customer.account.address.create.postcode') }}</label>
|
||||
|
||||
<input type="text" class="control" name="postcode" value="{{ old('postcode') }}" v-validate="'required'" data-vv-as=""{{ __('shop::app.customer.account.address.create.postcode') }}"">
|
||||
|
||||
<span class="control-error" v-if="errors.has('postcode')" v-text="errors.first('postcode')"></span>
|
||||
</div>
|
||||
|
||||
|
|
@ -98,7 +111,9 @@
|
|||
|
||||
<div class="control-group" :class="[errors.has('phone') ? 'has-error' : '']">
|
||||
<label for="phone" class="mandatory">{{ __('shop::app.customer.account.address.create.phone') }}</label>
|
||||
|
||||
<input type="text" class="control" name="phone" value="{{ old('phone') }}" v-validate="'required'" data-vv-as=""{{ __('shop::app.customer.account.address.create.phone') }}"">
|
||||
|
||||
<span class="control-error" v-if="errors.has('phone')" v-text="errors.first('phone')"></span>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -7,24 +7,25 @@
|
|||
@section('page-detail-wrapper')
|
||||
<div class="account-head mb-15">
|
||||
<span class="account-heading">{{ __('shop::app.customer.account.address.edit.title') }}</span>
|
||||
|
||||
<span></span>
|
||||
</div>
|
||||
|
||||
{!! view_render_event('bagisto.shop.customers.account.address.edit.before', ['address' => $address]) !!}
|
||||
|
||||
<form method="post" action="{{ route('customer.address.update', $address->id) }}" @submit.prevent="onSubmit">
|
||||
|
||||
<div class="account-table-content">
|
||||
@method('PUT')
|
||||
|
||||
@csrf
|
||||
|
||||
{!! view_render_event('bagisto.shop.customers.account.address.edit_form_controls.before', ['address' => $address]) !!}
|
||||
|
||||
<?php $addresses = explode(PHP_EOL, (old('address1') ?? $address->address1)); ?>
|
||||
|
||||
<div class="control-group" :class="[errors.has('company_name') ? 'has-error' : '']">
|
||||
<label for="company_name">{{ __('shop::app.customer.account.address.edit.company_name') }}</label>
|
||||
|
||||
<input type="text" class="control" name="company_name" value="{{ old('company_name') ?? $address->company_name }}" data-vv-as=""{{ __('shop::app.customer.account.address.edit.company_name') }}"">
|
||||
|
||||
<span class="control-error" v-if="errors.has('company_name')" v-text="errors.first('company_name')"></span>
|
||||
</div>
|
||||
|
||||
|
|
@ -32,7 +33,9 @@
|
|||
|
||||
<div class="control-group" :class="[errors.has('first_name') ? 'has-error' : '']">
|
||||
<label for="first_name" class="mandatory">{{ __('shop::app.customer.account.address.create.first_name') }}</label>
|
||||
|
||||
<input type="text" class="control" name="first_name" value="{{ old('first_name') ?? $address->first_name }}" v-validate="'required'" data-vv-as=""{{ __('shop::app.customer.account.address.create.first_name') }}"">
|
||||
|
||||
<span class="control-error" v-if="errors.has('first_name')" v-text="errors.first('first_name')"></span>
|
||||
</div>
|
||||
|
||||
|
|
@ -40,7 +43,9 @@
|
|||
|
||||
<div class="control-group" :class="[errors.has('last_name') ? 'has-error' : '']">
|
||||
<label for="last_name" class="mandatory">{{ __('shop::app.customer.account.address.create.last_name') }}</label>
|
||||
|
||||
<input type="text" class="control" name="last_name" value="{{ old('last_name') ?? $address->last_name }}" v-validate="'required'" data-vv-as=""{{ __('shop::app.customer.account.address.create.last_name') }}"">
|
||||
|
||||
<span class="control-error" v-if="errors.has('last_name')" v-text="errors.first('last_name')"></span>
|
||||
</div>
|
||||
|
||||
|
|
@ -50,15 +55,23 @@
|
|||
<label for="vat_id">{{ __('shop::app.customer.account.address.create.vat_id') }}
|
||||
<span class="help-note">{{ __('shop::app.customer.account.address.create.vat_help_note') }}</span>
|
||||
</label>
|
||||
|
||||
<input type="text" class="control" name="vat_id" value="{{ old('vat_id') ?? $address->vat_id }}" v-validate="" data-vv-as=""{{ __('shop::app.customer.account.address.create.vat_id') }}"">
|
||||
|
||||
<span class="control-error" v-if="errors.has('vat_id')" v-text="errors.first('vat_id')"></span>
|
||||
</div>
|
||||
|
||||
{!! view_render_event('bagisto.shop.customers.account.address.edit_form_controls.vat_id.after') !!}
|
||||
|
||||
@php
|
||||
$addresses = old('address1') ?? explode(PHP_EOL, $address->address1);
|
||||
@endphp
|
||||
|
||||
<div class="control-group" :class="[errors.has('address1[]') ? 'has-error' : '']">
|
||||
<label for="address_0" class="mandatory">{{ __('shop::app.customer.account.address.edit.street-address') }}</label>
|
||||
|
||||
<input type="text" class="control" name="address1[]" value="{{ isset($addresses[0]) ? $addresses[0] : '' }}" id="address_0" v-validate="'required'" data-vv-as=""{{ __('shop::app.customer.account.address.create.street-address') }}"">
|
||||
|
||||
<span class="control-error" v-if="errors.has('address1[]')" v-text="errors.first('address1[]')"></span>
|
||||
</div>
|
||||
|
||||
|
|
@ -78,7 +91,9 @@
|
|||
|
||||
<div class="control-group" :class="[errors.has('city') ? 'has-error' : '']">
|
||||
<label for="city" class="mandatory">{{ __('shop::app.customer.account.address.create.city') }}</label>
|
||||
|
||||
<input type="text" class="control" name="city" value="{{ old('city') ?? $address->city }}" v-validate="'required|regex:^[a-zA-Z \-]*$'" data-vv-as=""{{ __('shop::app.customer.account.address.create.city') }}"">
|
||||
|
||||
<span class="control-error" v-if="errors.has('city')" v-text="errors.first('city')"></span>
|
||||
</div>
|
||||
|
||||
|
|
@ -86,7 +101,9 @@
|
|||
|
||||
<div class="control-group" :class="[errors.has('postcode') ? 'has-error' : '']">
|
||||
<label for="postcode" class="mandatory">{{ __('shop::app.customer.account.address.create.postcode') }}</label>
|
||||
|
||||
<input type="text" class="control" name="postcode" value="{{ old('postcode') ?? $address->postcode }}" v-validate="'required'" data-vv-as=""{{ __('shop::app.customer.account.address.create.postcode') }}"">
|
||||
|
||||
<span class="control-error" v-if="errors.has('postcode')" v-text="errors.first('postcode')"></span>
|
||||
</div>
|
||||
|
||||
|
|
@ -94,7 +111,9 @@
|
|||
|
||||
<div class="control-group" :class="[errors.has('phone') ? 'has-error' : '']">
|
||||
<label for="phone" class="mandatory">{{ __('shop::app.customer.account.address.create.phone') }}</label>
|
||||
|
||||
<input type="text" class="control" name="phone" value="{{ old('phone') ?? $address->phone }}" v-validate="'required'" data-vv-as=""{{ __('shop::app.customer.account.address.create.phone') }}"">
|
||||
|
||||
<span class="control-error" v-if="errors.has('phone')" v-text="errors.first('phone')"></span>
|
||||
</div>
|
||||
|
||||
|
|
@ -114,7 +133,6 @@
|
|||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
{!! view_render_event('bagisto.shop.customers.account.address.edit.after', ['address' => $address]) !!}
|
||||
|
|
|
|||
Loading…
Reference in New Issue