⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.14
Server IP:
178.33.27.10
Server:
Linux cpanel.dev-unit.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
Server Software:
Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips
PHP Version:
8.2.25
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
id
/
taxi.dev-unit.com
/
app
/
Base
/
Services
/
OTP
/
View File Name :
CanSendOTP.php
<?php namespace App\Base\Services\OTP; use App\Base\Services\OTP\Handler\OTPHandlerContract; trait CanSendOTP { /** * Create a new OTP for the user. * * @return bool */ public function createOTP() { return $this->getOTPHandler()->create(); } /** * Get the created OTP. * * @return string */ public function getCreatedOTP() { return $this->getOTPHandler()->getOtp(); } /** * Get the UUID of the created OTP. * * @return string */ public function getCreatedOTPUuid() { return $this->getOTPHandler()->getUuid(); } /** * Check if the user entered OTP is valid. * * @param string $otp * @return bool */ public function validateOTP($otp) { return $this->getOTPHandler()->validate($otp); } /** * Delete the user's OTP entry in the table. * * @return mixed */ public function deleteOTP() { return $this->getOTPHandler()->delete(); } /** * Get the current user's mobile number for sending OTP. * * @return string */ public function getMobileNumberForSendingOTP() { return $this->mobile; } /** * Get the OTP handler instance for the current mobile number. * * @return \App\Base\Services\OTP\Handler\OTPHandlerContract */ protected function getOTPHandler() { return app(OTPHandlerContract::class) ->setMobile($this->getMobileNumberForSendingOTP()); } }