@extends('layouts.backend') @section('title', '| Edit User') @section('content')
@if (count($errors) > 0)
Something went wrong.

@endif @if(isset($user_edit_code_error) || $user_edit_code_error = Session::get('user_edit_code_error'))
{{ $user_edit_code_error }}
@endif

Edit User Details

{!! Form::model($user, ['method' => 'PATCH','route' => ['users.update', $user->id]]) !!}
{!! Form::text('name', null, array('placeholder' => 'Name','class' => 'form-control')) !!}
{!! Form::text('email', null, array('placeholder' => 'Email','class' => 'form-control')) !!}
+
{!! Form::text('phone_country_code', null, array('placeholder' => 'CC','class' => 'form-control', 'readonly' => 'readonly')) !!}
{!! Form::text('phone_number', null, array('placeholder' => 'Phone Number','class' => 'form-control', 'maxlength' => '12','id' => 'phone_number')) !!}
{{--This error for will come if client enter wrong zipcode and fetch_complete_address_by_zipcode.js is not getting any response--}}
{!! Form::text('street', null, array('placeholder' => 'Street Address','class' => 'form-control','id' => 'street')) !!}
{{-- Author : Gurupriya Solanki Update Date:6 May 2025 Description: Added Street Address 2 field and store. its not mandatory. And Show here if user has. --}}
{!! Form::text('street_2', null, array('placeholder' => 'Apt., suite, unit number, etc. (optional)','class' => 'form-control','id' => 'street_2')) !!}
{!! Form::text('city', null, array('placeholder' => 'City','class' => 'form-control' ,'id' => 'city')) !!}
{!! Form::text('state', null, array('placeholder' => 'State','class' => 'form-control' ,'id' => 'state')) !!} {!! Form::hidden('state_abbreviation', null, array('placeholder' => 'State Abbreviation','class' => 'form-control' ,'id' => 'state_abbreviation')) !!}
{!! Form::text('country', old('country', $user->country ?: 'United States'), array('placeholder' => 'Country', 'class' => 'form-control', 'id' => 'country')) !!} {!! Form::hidden('country_abbreviation', old('country', $user->country_abbreviation ?: 'US'), array('placeholder' => 'country Abbreviation','class' => 'form-control' ,'id' => 'country_abbreviation')) !!}
{{-- * If user enters zip code first then fetch and display user city,state, country values * If user enters city,state, country values then call zipcode AJAX API and cross check the values are correct or not? If not correct then replace API values. * This JS is calling in frontend and backend(Admin side) when user is creating and updating --}}
{!! Form::text('zip', null, array('placeholder' => 'Zipcode','class' => 'form-control', 'maxlength'=>'5' ,'id' => 'zip')) !!} {{--Here number validtionis checking by public\fetch_complete_address_by_zipcode.js . For Future use number_validation class and validateInputNumber() to valid that user can enter only number available public/backend/dist/js/customValidation.js--}} {{--This error for will come if client enter wrong zipcode and fetch_complete_address_by_zipcode.js is not getting any response--}}
{{-- Date : 2024-03-27 Author : Theshan Thanushka Conditional Rendering: This block determines whether to display a role selector dropdown or a readonly field based on the user's permissions and role. Author : Gurupriya Solanki Description : If role is customer and superAdmin then role will not changeable. if role is other then it will changeable Update Date : 30 May 2024 --}} @if (Auth::user()->can('users-role-manage') && !in_array('Super Admin', $userRole) && !(count($userRole) == 1 && in_array('Customer', $userRole)))
@elseif(in_array('Super Admin', $userRole))
@elseif(in_array('Customer', $userRole))
@else
@endif {!! Form::close() !!}
@endsection