saeed/otp
Composer 安装命令:
composer require saeed/otp
包简介
otp for send password to whatsapp 1
README 文档
README
This guide walks you through setting up the OTP (One-Time Password) authentication package for your Laravel project.
Prerequisites
- A UltraMsg account.
- Laravel installed on your project.
Setup Instructions
1. Register for UltraMsg
- Visit UltraMsg and create an account.
- Obtain the following credentials:
- Instance
- Token
2. Install the OTP Package
Run the following command in your Laravel project terminal:
composer require saeed/otp:dev-main
3. Update Composer Autoload
-
Open your
composer.jsonfile. -
Add the following line to the
autoloadsection:"Saeed\\Otp\\": "src/"
-
Run the following command to update the autoloader:
composer dump-autoload
4. Configure the Service Provider
-
Open the
config/app.phpfile. -
Add the service provider to the
providersarray:Saeed\Otp\OtpServiceProvider::class,
-
Add an alias to the
aliasesarray:'Otp' => Saeed\Otp\OtpFacade::class,
5. Update Authentication Providers
-
Open the
config/auth.phpfile. -
Replace the default model entry with the OTP User model:
'model' => \Saeed\Otp\Models\OtpUser::class,
6. Publish Configuration File
To publish the package configuration, run:
php artisan vendor:publish --provider="Saeed\Otp\OtpServiceProvider" --tag="otp" --force
7. Configure Instance and Token
-
Open the published configuration file:
config/otp.php. -
Add your UltraMsg credentials:
'WhatsApp_Instance' => 'your_instance', 'WhatsApp_Token' => 'your_token',
8. Run Database Migrations
Run the following command to create the required database tables:
php artisan migrate
9. Create a Home Page
You can now create a home page in your application to implement and utilize OTP functionality.
Notes
- Ensure you have your
.envfile properly configured for database and app settings before running migrations. - For more details and advanced usage, refer to the package documentation or contact the package maintainer.
Happy Coding! 🚀
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2025-01-07