How this workflow fits
Install the crate and inject Otp
Run cargo add hypersender-laravel-rust, register HypersenderServiceProvider in src/app.rs, and set HYPERSENDER_OTP_API_KEY and HYPERSENDER_OTP_INSTANCE_ID in .env. Any handler can then take Inject<Otp> as an argument, the same way it takes any other Laravel Rust service.
- Needs Rust 1.99 or newer and Laravel Rust 0.1.
- The crate turns off laravel-rust's default features, so it adds nothing to your build you didn't ask for.
- Your API token stays on the server; the browser only sees your own routes.
Send the code, then check it
request_code takes the user's chat ID, the code length, your app's name for the message and the lifetime in seconds. When the user submits the form, validate_code checks it, and the response's data.status is validated when the code is right.
- Codes are 4 to 10 characters, and request_code_with lets you add letters or capitals.
- A code lasts from 1 to 30 minutes and works once.
- After 5 wrong tries the code stops accepting guesses.
One-tap login links and SMS
generate_link returns a WhatsApp link with the code already in the message. The user taps it, sends it, and Hypersender calls your success URL, so there's nothing to type. For users without WhatsApp, point the OTP settings at an SMS instance and the same calls send the code from your Android phone's SIM.
- You write the prompt, success, failure and expiry messages.
- In tests, client::fake() catches every OTP call, so no real codes go out.
- OTP is part of the WhatsApp plan, from $9.99 per number a month, with no fee per code.

