Merge branch 'main' of https://github.com/Ritikeshyadav/my-freeu into megha
This commit is contained in:
@@ -11,6 +11,7 @@ use Illuminate\Support\Facades\Session;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use DataTables;
|
||||
use Mail;
|
||||
use App\Mail\sendEmailOTP;
|
||||
use App\Mail\UpdatePasswordMail;
|
||||
|
||||
class AdminProfileController extends Controller
|
||||
@@ -21,6 +22,51 @@ class AdminProfileController extends Controller
|
||||
return view('Admin.Pages.manage_sub_admin.edit_admin_profile', compact('data'));
|
||||
}
|
||||
|
||||
public function sendOtpOnMail(Request $request)
|
||||
{
|
||||
// dd($request->all());
|
||||
$validator = validator::make($request->all(),['new_email'=>'required|unique:users,email'],['requreid'=>'Email field is required.','unique'=>'Email should be unique.']);
|
||||
$validateMessage = validationErrorMessage($validator);
|
||||
if($validateMessage)
|
||||
{
|
||||
return response()->json(['status'=>400,'message'=>$validateMessage]);
|
||||
}
|
||||
$OTP = rand(1000,9999);
|
||||
Mail::to($request->new_email)->send(new sendEmailOTP($OTP));
|
||||
session()->forget(['email_update_otp','old_email','new_email']);
|
||||
session()->put('email_update_otp',$OTP);
|
||||
session()->put('old_email',$request->old_email);
|
||||
session()->put('new_email',$request->new_email);
|
||||
if(session()->has('email_update_otp') || session()->has('old_email') || session()->has('new_email'))
|
||||
{
|
||||
return response()->json(['status'=>200,'message'=>"OTP has been send to your mail."]);
|
||||
}
|
||||
return response()->json(['status'=>400,'message'=>"Error in sending OTP."]);
|
||||
}
|
||||
|
||||
public function verifyEmailOtp(Request $request)
|
||||
{
|
||||
$otp = session()->get('email_update_otp');
|
||||
$old_email = session()->get('old_email');
|
||||
$new_email = session()->get('new_email');
|
||||
// dd($new_email,$old_email);
|
||||
if(!$otp && !$old_email && !$new_email)
|
||||
{
|
||||
return response()->json(['status'=>400,'message'=>'Enter your email again.']);
|
||||
}
|
||||
|
||||
if((int)$otp != (int)$request->email_otp)
|
||||
{
|
||||
return response()->json(['status'=>400,'message'=>'OTP not matched.']);
|
||||
}
|
||||
|
||||
$updated = User::where('email',$old_email)->update(['email'=>$new_email]);
|
||||
if($updated)
|
||||
{
|
||||
return response()->json(['status'=>200,'message'=>'Email updated successfully']);
|
||||
}
|
||||
|
||||
}
|
||||
public function getUsers(Request $request)
|
||||
{
|
||||
if ($request->ajax()) {
|
||||
|
||||
36
app/Mail/sendEmailOTP.php
Normal file
36
app/Mail/sendEmailOTP.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mail;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class sendEmailOTP extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected $otp;
|
||||
|
||||
public function __construct($otp)
|
||||
{
|
||||
$this->otp = $otp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the message.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function build()
|
||||
{
|
||||
$otp = $this->otp;
|
||||
return $this->subject('OTP from Jericho Altenatives')->view('Admin.email.otp-mail',compact('otp'));
|
||||
}
|
||||
}
|
||||
@@ -1521,3 +1521,17 @@ label.error {
|
||||
.modal .tabdiv label.error {
|
||||
padding: 6px 6px 6px 20px !important;
|
||||
}
|
||||
|
||||
a.edit_email {
|
||||
position: absolute;
|
||||
top: 45px;
|
||||
right: 22px;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.email {
|
||||
position: relative;
|
||||
}
|
||||
#admin_email_update label, #admin_email_update input {
|
||||
width: 100%;
|
||||
}
|
||||
@@ -1,205 +1,399 @@
|
||||
@extends('Admin.layouts.master')
|
||||
@section('content')
|
||||
<div class="app-main flex-column flex-row-fluid" id="kt_app_main">
|
||||
<div class="d-flex flex-column flex-column-fluid">
|
||||
<div id="kt_app_content_container" class="app-container container-xxl">
|
||||
<div class="row max-w-100 mt-10 index_table">
|
||||
<div class="top_header d-flex justify-content-between">
|
||||
<p class='fs-2 fw-bold'>Update Profile</p>
|
||||
<div class="table_right_options d-flex">
|
||||
<a class="btn btn-primary me-3" href="{{route('dashboard')}}">Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dataTable_area my-5 mb-0">
|
||||
<div class="card">
|
||||
<div class="modal-body scroll-y px-10 px-lg-15 pt-0 pb-2">
|
||||
<form id="update_profile" class="form py-5 pb-0">
|
||||
@csrf
|
||||
@method('post')
|
||||
<div class="row">
|
||||
<div class="col-md-6 fv-row mt-2">
|
||||
<label class="required fs-6 fw-semibold mb-2">Name</label>
|
||||
<input type="hidden" name="update_id" value="{{$data->id}}">
|
||||
<input type="text" class="form-control form-control-solid" placeholder="" name="name" value="{{$data->name}}" />
|
||||
</div>
|
||||
<div class="col-md-6 fv-row mt-2">
|
||||
<label class="required fs-6 fw-semibold mb-2">email</label>
|
||||
<input type="email" class="form-control form-control-solid" placeholder="" name="email" value="{{$data->email}}" />
|
||||
</div>
|
||||
<div class="col-md-6 fv-row mt-4">
|
||||
<label class="required fs-6 fw-semibold mb-2">Contact Number</label>
|
||||
<input type="number" class="form-control form-control-solid" placeholder="" name="mobile_number" value="{{$data->contact_number}}" />
|
||||
</div>
|
||||
<div class="col-md-6 fv-row mt-4">
|
||||
<label class="required fs-6 fw-semibold mb-2">Profile Image</label>
|
||||
<input type="file" class="form-control form-control-solid" placeholder="" name="profile_image" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-center my-6">
|
||||
<button type="submit" class="btn btn-dark smt-btns">Update</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="app-main flex-column flex-row-fluid" id="kt_app_main">
|
||||
<div class="d-flex flex-column flex-column-fluid">
|
||||
<div id="kt_app_content_container" class="app-container container-xxl">
|
||||
<div class="row max-w-100 mt-10 index_table">
|
||||
<div class="top_header d-flex justify-content-between">
|
||||
<p class='fs-2 fw-bold'>Update Profile</p>
|
||||
<div class="table_right_options d-flex">
|
||||
<a class="btn btn-primary me-3" href="{{ route('dashboard') }}">Back</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="app-main flex-column flex-row-fluid" id="kt_app_main">
|
||||
<div class="d-flex flex-column flex-column-fluid">
|
||||
<div id="kt_app_content_container" class="app-container container-xxl">
|
||||
<div class="row max-w-100 index_table mt-10">
|
||||
<div class="add_new_investors my-5 mb-0">
|
||||
<div class="top_header d-flex justify-content-between">
|
||||
<p class='fs-2 fw-bold'>Update Password</p>
|
||||
</div>
|
||||
<form id="update_password" autocomplete="off">
|
||||
@csrf
|
||||
@method('post')
|
||||
<div class="card mb-8">
|
||||
<div class="card-body py-4">
|
||||
<div class="row add_category_area">
|
||||
<div class="col-md-6 fv-row mt-2">
|
||||
<label class="fs-6 fw-semibold mb-2">Current Password</label>
|
||||
<input type="hidden" name="updateId" value="{{$data->id}}">
|
||||
<input type="password" class="form-control form-control-solid" placeholder="" name="current_password" id="current_password" />
|
||||
<div class="dataTable_area my-5 mb-0">
|
||||
<div class="card">
|
||||
<div class="modal-body scroll-y px-10 px-lg-15 pt-0 pb-2">
|
||||
<form id="update_profile" class="form py-5 pb-0">
|
||||
@csrf
|
||||
@method('post')
|
||||
<div class="row">
|
||||
<div class="col-md-6 fv-row mt-2">
|
||||
<label class="required fs-6 fw-semibold mb-2">Name</label>
|
||||
<input type="hidden" name="update_id" value="{{ $data->id }}">
|
||||
<input type="text" class="form-control form-control-solid" placeholder=""
|
||||
name="name" value="{{ $data->name }}" />
|
||||
</div>
|
||||
<div class="col-md-6 fv-row mt-2 email">
|
||||
<label class="required fs-6 fw-semibold mb-2">Email</label>
|
||||
<input type="email" class="form-control form-control-solid" placeholder=""
|
||||
id="email" name="email" readonly value="{{ $data->email }}" />
|
||||
<a class="edit_email" data-old-email="{{ $data->email }}"><i
|
||||
class="fa-solid fs-5 fa-pen-to-square"></i></a>
|
||||
</div>
|
||||
<div class="col-md-6 fv-row mt-4">
|
||||
<label class="required fs-6 fw-semibold mb-2">Contact Number</label>
|
||||
<input type="number" class="form-control form-control-solid" placeholder=""
|
||||
name="mobile_number" value="{{ $data->contact_number }}" />
|
||||
</div>
|
||||
<div class="col-md-6 fv-row mt-4">
|
||||
<label class="required fs-6 fw-semibold mb-2">Profile Image</label>
|
||||
<input type="file" class="form-control form-control-solid" placeholder=""
|
||||
name="profile_image" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 fv-row mt-2">
|
||||
<label class="fs-6 fw-semibold mb-2">New Password</label>
|
||||
<input type="password" class="form-control form-control-solid" placeholder="" id="password" name="password" />
|
||||
<div class="d-flex justify-content-center my-6">
|
||||
<button type="submit" class="btn btn-dark smt-btns">Update</button>
|
||||
</div>
|
||||
<div class="col-md-6 fv-row mt-2">
|
||||
<label class="fs-6 fw-semibold mb-2">Confirm Password</label>
|
||||
<input type="password" class="form-control form-control-solid" placeholder="" id="password_confirmation" name="password_confirmation" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="submit_btn d-flex justify-content-center my-6">
|
||||
<button id="save_btn" type="submit" class="btn btn-dark smt-btns">Update</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="app-main flex-column flex-row-fluid" id="kt_app_main">
|
||||
<div class="d-flex flex-column flex-column-fluid">
|
||||
<div id="kt_app_content_container" class="app-container container-xxl">
|
||||
<div class="row max-w-100 index_table mt-10">
|
||||
<div class="add_new_investors my-5 mb-0">
|
||||
<div class="top_header d-flex justify-content-between">
|
||||
<p class='fs-2 fw-bold'>Update Password</p>
|
||||
</div>
|
||||
<form id="update_password" autocomplete="off">
|
||||
@csrf
|
||||
@method('post')
|
||||
<div class="card mb-8">
|
||||
<div class="card-body py-4">
|
||||
<div class="row add_category_area">
|
||||
<div class="col-md-6 fv-row mt-2">
|
||||
<label class="fs-6 fw-semibold mb-2">Current Password</label>
|
||||
<input type="hidden" name="updateId" value="{{ $data->id }}">
|
||||
<input type="password" class="form-control form-control-solid" placeholder=""
|
||||
name="current_password" id="current_password" />
|
||||
</div>
|
||||
<div class="col-md-6 fv-row mt-2">
|
||||
<label class="fs-6 fw-semibold mb-2">New Password</label>
|
||||
<input type="password" class="form-control form-control-solid" placeholder=""
|
||||
id="password" name="password" />
|
||||
</div>
|
||||
<div class="col-md-6 fv-row mt-2">
|
||||
<label class="fs-6 fw-semibold mb-2">Confirm Password</label>
|
||||
<input type="password" class="form-control form-control-solid" placeholder=""
|
||||
id="password_confirmation" name="password_confirmation" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="submit_btn d-flex justify-content-center my-6">
|
||||
<button id="save_btn" type="submit" class="btn btn-dark smt-btns">Update</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- edit email popup modal start --}}
|
||||
<div class="modal fade" id="getEmailModal" aria-hidden="true" aria-labelledby="getEmailModalLabel" tabindex="-1">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<form id="admin_email_update">
|
||||
@csrf
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="getEmailModalLabel">Edit Email</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{{-- Show a second modal and hide this one with the button below. --}}
|
||||
<div>
|
||||
<label for="email" class="mb-2">New Email</label>
|
||||
<input type="hidden" name="old_email" id="old_email">
|
||||
<input type="email" placeholder="Enter your email" name="new_email" id="new_email"
|
||||
class="form-control form-control-solid valid">
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
{{-- <button class="btn btn-primary" data-bs-target="#getEmailModal2" data-bs-toggle="modal" data-bs-dismiss="modal">Send OTP</button> --}}
|
||||
<button class="btn btn-primary" type="submit" id="sendEmailOtp">Send OTP</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{-- edit email popup modal end --}}
|
||||
{{-- edit email otp popup modal start --}}
|
||||
<div class="modal fade" id="email_otp" aria-hidden="true" aria-labelledby="getEmailModalLabel" tabindex="-1">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<form id="verify_email_otp">
|
||||
@csrf
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="getEmailModalLabel">OTP</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{{-- Show a second modal and hide this one with the button below. --}}
|
||||
<div>
|
||||
<label for="email_otp" class="mb-2">Enter OTP</label>
|
||||
<input type="number" name="email_otp" id="email_otp" class="form-control form-control-solid valid">
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
{{-- <button class="btn btn-primary" data-bs-target="#getEmailModal2" data-bs-toggle="modal" data-bs-dismiss="modal">Send OTP</button> --}}
|
||||
<button class="btn btn-primary" type="submit" id="verifyEmailOtp">Verify OTP</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{-- edit email otp popup modal end --}}
|
||||
@endsection
|
||||
@section('scripts')
|
||||
<script>
|
||||
$('#update_profile').validate({
|
||||
ignore: [],
|
||||
debug: false,
|
||||
rules: {
|
||||
name: 'required',
|
||||
email: 'required',
|
||||
mobile_number: 'required',
|
||||
},
|
||||
message: {
|
||||
name: "Enter your name",
|
||||
email: "Enter your email",
|
||||
mobile_number: "Enter your mobile number",
|
||||
},
|
||||
submitHandler: function(form)
|
||||
{
|
||||
var formData = new FormData(form);
|
||||
$.ajax({
|
||||
url: "{{route('update-profile')}}",
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
dataType: 'json',
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success: function(result)
|
||||
{
|
||||
if (result.status == 200)
|
||||
{
|
||||
toastr.success(result.message);
|
||||
setTimeout(function() {
|
||||
<script>
|
||||
$('.edit_email').on('click', function() {
|
||||
$('#old_email').val($(this).data('old-email'));
|
||||
$('#getEmailModal').modal('show');
|
||||
});
|
||||
|
||||
$('#admin_email_update').validate({
|
||||
ignore: [],
|
||||
debug: false,
|
||||
rules: {
|
||||
new_email: {
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
messages: {
|
||||
new_email: {
|
||||
required: 'Enter your email',
|
||||
},
|
||||
},
|
||||
submitHandler: function(form) {
|
||||
var formData = new FormData(form);
|
||||
$.ajax({
|
||||
url: "{{ route('send-otp-on-mail') }}",
|
||||
type: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: formData,
|
||||
dataType: 'json',
|
||||
contentType: false, // Required for FormData
|
||||
processData: false, // Required for FormData
|
||||
success: function(result) {
|
||||
if (result.status == 200) {
|
||||
// Handle success case
|
||||
// toastr.success(result.message);
|
||||
$('#getEmailModal').modal('hide')
|
||||
$('#email_otp').modal('show')
|
||||
// setTimeout(function(){},3000)
|
||||
} else {
|
||||
toastr.warning(result.message);
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
toastr.error('Error occurred while sending request.');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
$('#verify_email_otp').validate({
|
||||
ignore: [],
|
||||
debug: false,
|
||||
rules: {
|
||||
email_otp: {
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
messages: {
|
||||
email_otp: {
|
||||
required: 'Enter your OTP',
|
||||
},
|
||||
},
|
||||
submitHandler: function(form) {
|
||||
var formData = new FormData(form);
|
||||
$.ajax({
|
||||
url: "{{ route('verify-email-update-otp') }}",
|
||||
type: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: formData,
|
||||
dataType: 'json',
|
||||
contentType: false, // Required for FormData
|
||||
processData: false, // Required for FormData
|
||||
success: function(result) {
|
||||
if (result.status == 200) {
|
||||
// Handle success case
|
||||
// toastr.success(result.message);
|
||||
$('#getEmailModal').modal('hide')
|
||||
$('#email_otp').modal('hide')
|
||||
toastr.success(result.message);
|
||||
setTimeout(function() {
|
||||
window.reload()
|
||||
}, 3000)
|
||||
} else {
|
||||
toastr.warning(result.message);
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
toastr.error('Error occurred while sending request.');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
// $('#admin_email_update').validate({
|
||||
// ignore: [],
|
||||
// debug: false,
|
||||
// rules:{
|
||||
// new_email:{
|
||||
// required: true,
|
||||
// },
|
||||
// },
|
||||
// messages:{
|
||||
// new_email:{
|
||||
// required: 'Enter your email',
|
||||
// },
|
||||
// },
|
||||
// submitHandler: function(form){
|
||||
// var formData = FormData(form);
|
||||
|
||||
// $.ajax({
|
||||
// url:"{{ route('send-otp-on-mail') }}",
|
||||
// type:'POST',
|
||||
// // $.ajaxSetup({
|
||||
// headers: {
|
||||
// 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
// },
|
||||
// // });
|
||||
// data: formData,
|
||||
// dataType: 'json',
|
||||
// // contentType: false,
|
||||
// // processData: false,
|
||||
// success:function(result)
|
||||
// {
|
||||
// if(result.status == 200)
|
||||
// {
|
||||
|
||||
// }
|
||||
// else{
|
||||
// toastr.warning(result.message);
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// });
|
||||
|
||||
$('#update_profile').validate({
|
||||
ignore: [],
|
||||
debug: false,
|
||||
rules: {
|
||||
name: 'required',
|
||||
email: 'required',
|
||||
mobile_number: 'required',
|
||||
},
|
||||
message: {
|
||||
name: "Enter your name",
|
||||
email: "Enter your email",
|
||||
mobile_number: "Enter your mobile number",
|
||||
},
|
||||
submitHandler: function(form) {
|
||||
var formData = new FormData(form);
|
||||
$.ajax({
|
||||
url: "{{ route('update-profile') }}",
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
dataType: 'json',
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success: function(result) {
|
||||
if (result.status == 200) {
|
||||
toastr.success(result.message);
|
||||
setTimeout(function() {
|
||||
window.location.reload()
|
||||
}
|
||||
, 2000);
|
||||
} else
|
||||
{
|
||||
toastr.warning(result.message);
|
||||
}, 2000);
|
||||
} else {
|
||||
toastr.warning(result.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
$(function() {
|
||||
$.validator.addMethod(
|
||||
"InputDifferent",
|
||||
function(value, element, param) {
|
||||
return this.optional(element) || value !== $(param).val();
|
||||
},
|
||||
'Current Password Should Not Be Same As New Password'
|
||||
);
|
||||
$.validator.addMethod(
|
||||
"StrongPassword",
|
||||
function(value) {
|
||||
return /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/.test(
|
||||
value
|
||||
);
|
||||
},
|
||||
"Password Must Contain <br> 8 characters <br> At least 1 uppercase letter and symbol <br> Has a number"
|
||||
);
|
||||
})
|
||||
$(function() {
|
||||
$.validator.addMethod(
|
||||
"InputDifferent",
|
||||
function(value, element, param) {
|
||||
return this.optional(element) || value !== $(param).val();
|
||||
},
|
||||
'Current Password Should Not Be Same As New Password'
|
||||
);
|
||||
$.validator.addMethod(
|
||||
"StrongPassword",
|
||||
function(value) {
|
||||
return /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/.test(
|
||||
value
|
||||
);
|
||||
},
|
||||
"Password Must Contain <br> 8 characters <br> At least 1 uppercase letter and symbol <br> Has a number"
|
||||
);
|
||||
})
|
||||
|
||||
|
||||
$('#update_password').validate({
|
||||
rules: {
|
||||
current_password: 'required',
|
||||
password: {
|
||||
required: true,
|
||||
InputDifferent: '#current_password',
|
||||
StrongPassword: true,
|
||||
$('#update_password').validate({
|
||||
rules: {
|
||||
current_password: 'required',
|
||||
password: {
|
||||
required: true,
|
||||
InputDifferent: '#current_password',
|
||||
StrongPassword: true,
|
||||
},
|
||||
password_confirmation: {
|
||||
required: true,
|
||||
equalTo: '#password',
|
||||
},
|
||||
},
|
||||
password_confirmation: {
|
||||
required: true,
|
||||
equalTo: '#password',
|
||||
message: {
|
||||
current_password: {
|
||||
required: "This :attribute field is required",
|
||||
},
|
||||
password: {
|
||||
required: "This :attribute field is required",
|
||||
},
|
||||
password_confirmation: {
|
||||
required: "This :attribute field is required",
|
||||
equalTo: "Your password does not match",
|
||||
},
|
||||
},
|
||||
},
|
||||
message: {
|
||||
current_password: {
|
||||
required: "This :attribute field is required",
|
||||
},
|
||||
password: {
|
||||
required: "This :attribute field is required",
|
||||
},
|
||||
password_confirmation: {
|
||||
required: "This :attribute field is required",
|
||||
equalTo: "Your password does not match",
|
||||
},
|
||||
},
|
||||
submitHandler: function(form)
|
||||
{
|
||||
var formData = new FormData(form);
|
||||
$.ajax({
|
||||
url: "{{route('update-password')}}",
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function(result)
|
||||
{
|
||||
if (result.status == 200)
|
||||
{
|
||||
toastr.success(result.message);
|
||||
setTimeout(function() {
|
||||
window.location.href = '{{route("admin.login")}}';
|
||||
}, 2000);
|
||||
} else
|
||||
{
|
||||
toastr.warning(result.message);
|
||||
submitHandler: function(form) {
|
||||
var formData = new FormData(form);
|
||||
$.ajax({
|
||||
url: "{{ route('update-password') }}",
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: 'json',
|
||||
success: function(result) {
|
||||
if (result.status == 200) {
|
||||
toastr.success(result.message);
|
||||
setTimeout(function() {
|
||||
window.location.href = '{{ route('admin.login') }}';
|
||||
}, 2000);
|
||||
} else {
|
||||
toastr.warning(result.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
})
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@@ -1,44 +1,3 @@
|
||||
<!-- <!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
|
||||
<head>
|
||||
|
||||
<title>ItsolutionStuff.com</title>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h1>{{ $mailData['title'] }}</h1>
|
||||
|
||||
<p>{{ $mailData['body'] }}</p>
|
||||
|
||||
<p>{{$otp}}</p>
|
||||
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
|
||||
|
||||
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
|
||||
|
||||
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
|
||||
|
||||
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
|
||||
|
||||
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
|
||||
|
||||
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
||||
|
||||
|
||||
|
||||
<p>Thank you</p>
|
||||
|
||||
</body>
|
||||
|
||||
</html> -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!doctype html>
|
||||
|
||||
|
||||
@@ -172,6 +172,8 @@ Route::get('/view-clear', function () {
|
||||
|
||||
//admin update profile route
|
||||
Route::get('view-profile', [AdminProfileController::class, 'viewProfile'])->name('view-profile');
|
||||
Route::post('send-otp-on-mail', [AdminProfileController::class, 'sendOtpOnMail'])->name('send-otp-on-mail');
|
||||
Route::post('verify-email-update-otp', [AdminProfileController::class, 'verifyEmailOtp'])->name('verify-email-update-otp');
|
||||
Route::post('update-profile', [AdminProfileController::class, 'editProfile'])->name('update-profile');
|
||||
Route::post('update-password', [AdminProfileController::class, 'updatePassword'])->name('update-password');
|
||||
Route::get('view-user-password', [AdminProfileController::class, 'viewUsersProfile'])->name('view-user-password');
|
||||
|
||||
Reference in New Issue
Block a user