saeed / otp
otp for send password to whatsapp 1
Installs: 7
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 1
Open Issues: 0
Language:CSS
Requires
- illuminate/support: ^10.0
This package is auto-updated.
Last update: 2025-08-13 19:23:14 UTC
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.json
file. -
Add the following line to the
autoload
section:"Saeed\\Otp\\": "src/"
-
Run the following command to update the autoloader:
composer dump-autoload
4. Configure the Service Provider
-
Open the
config/app.php
file. -
Add the service provider to the
providers
array:Saeed\Otp\OtpServiceProvider::class,
-
Add an alias to the
aliases
array:'Otp' => Saeed\Otp\OtpFacade::class,
5. Update Authentication Providers
-
Open the
config/auth.php
file. -
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
.env
file 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! 🚀