Add state in register

This commit is contained in:
sayliraut
2024-05-27 12:30:30 +05:30
parent e2b50ba361
commit dde6ea7324
9 changed files with 130 additions and 11 deletions

View File

@@ -12,6 +12,7 @@ use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Hash;
use Illuminate\Database\QueryException;
use App\Models\IamPrincipal;
use App\Models\ManageState;
use Carbon\Carbon;
use Exception;
use Illuminate\Support\Facades\Log;
@@ -50,6 +51,22 @@ class AuthController extends Controller
}
}
/**
* Created By : sayli Raut
* Created at : 06 Feb 2024
* Use : Restaurant Details.
*/
public function viewstates()
{
try {
$response = $this->AuthServices->viewstates();
return jsonResponseWithSuccessMessageApi(__('success.data_fetched_successfully'), $response, 200);
} catch (\Exception $e) {
Log::error('FAW get data controller function failed: ' . $e->getMessage());
return jsonResponseWithErrorMessageApi(__('auth.something_went_wrong'), 500);
}
}
/**
* Created By : sayli Raut
* Created at : 24 May 2024
@@ -60,6 +77,7 @@ class AuthController extends Controller
try {
$validator = Validator::make($request->all(), [
'first_name' => 'required|string|min:2|max:100',
'last_name' => 'required|string|min:2|max:100',
'email_address' => [
'required',
'string',
@@ -84,7 +102,9 @@ class AuthController extends Controller
},
],
'phone_number' => 'required|min:10',
'address_line1' => 'required|max:50',
// 'address_line1' => 'required|max:50',
'state_xid' => 'required',
]);
@@ -128,7 +148,7 @@ class AuthController extends Controller
}
}
/**
/**
* Created By : sayli Raut
* Created at : 24 May 2024
* Use : forgot password.
@@ -156,7 +176,6 @@ class AuthController extends Controller
return jsonResponseWithErrorMessageApi($validationErrors, 403);
}
return $this->AuthServices->forgotPassword($request);
} catch (Exception $e) {
Log::error('Customer Forgot Password OTP function failed: ' . $e->getMessage());
return jsonResponseWithErrorMessageApi(__('auth.something_went_wrong'), 500);
@@ -193,7 +212,6 @@ class AuthController extends Controller
return jsonResponseWithErrorMessageApi($validationErrors, 403);
}
return $this->AuthServices->verifyOTPForgotPassword($request);
} catch (Exception $e) {
DB::rollBack();
Log::error("An error occurred in " . __METHOD__ . ": " . $e->getMessage());
@@ -201,7 +219,7 @@ class AuthController extends Controller
}
}
/**
/**
* Created By : sayli Raut
* Created at : 24 May 2024
* Use : Change Password.
@@ -219,14 +237,13 @@ class AuthController extends Controller
return jsonResponseWithErrorMessageApi($validationErrors, 403);
}
return $this->AuthServices->changePassword($request);
} catch (Exception $e) {
Log::error("An error occurred in " . __METHOD__ . ": " . $e->getMessage());
return response()->json(__('something_went_wrong'), 500);
}
}
/**
/**
* Created By : sayli Raut
* Created at : 24 May 2024
* Use : Resend OTP .

View File

@@ -105,4 +105,27 @@ class CMSApiController extends Controller
}
}
/**
* Created By : sayli Raut
* Created at : 24 May 2024
* Use : To get priivacy policy detail.
*/
public function getTermsConditon()
{
try {
$token = readHeaderToken();
if ($token) {
$customerIamId = $token['sub'];
$response = $this->CMSApiServices->getTermsConditon();
return jsonResponseWithSuccessMessageApi(__('success.data_fetched_successfully'), $response, 200);
} else {
return jsonResponseWithErrorMessageApi(__('auth.user_deleted'), 409);
}
} catch (\Exception $e) {
Log::error('FAW get data controller function failed: ' . $e->getMessage());
return jsonResponseWithErrorMessageApi(__('auth.something_went_wrong'), 500);
}
}
}

View File

@@ -53,8 +53,8 @@ class ContactUsApiController extends Controller
}
/**
* Created By : Hritik
* Created at : 30 JAN 2024
* Created By : Sayli Raut
* Created at : 27 May 2024
* Use : To validate Customer and Restaurant Contact form data
*/
public function validateContactForm(Request $request)