Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Kavenegar Laravel Package

masihjay-z/kavenegar

Laravel integration for the Kavenegar SMS API, providing a simple way to send SMS messages, OTP codes, and lookup-based notifications from your PHP applications through a clean, framework-friendly wrapper.

View on GitHub
Deep Wiki
Context7

laravel 4 and 5 kavenegar integration

Frequently asked questions about Kavenegar
How do I install and register masihjay-z/kavenegar in a Laravel 4 or 5 application?
Install it with Composer using composer require masihjay-z/kavenegar, then register the package's service provider in your config/app.php providers array and add the facade alias to the aliases array. You then publish the package configuration with php artisan vendor:publish and place your Kavenegar API key and sender line in your environment file. The package predates Laravel 5.5 auto-discovery, so manual provider and alias registration is expected in every Laravel version it supports.
Does this Kavenegar package support Laravel package auto-discovery?
No. It targets Laravel 4 and 5 and was written before the 5.5 discovery mechanism existed, so you must add the service provider and facade alias to config/app.php by hand. That is a small amount of work, but it also means the package will not be picked up automatically if you upgrade the surrounding application. Verify the provider class name against the package source rather than assuming, since the README excerpt does not spell it out.
How do I configure the Kavenegar API key and sender number?
Configuration is published to config/kavenegar.php via vendor:publish, and the usual pattern is an env-driven array holding the API key and the default sender line. Keep both values in .env and out of version control, because the API key authorises billable SMS sends on your account. Confirm the exact config key names in the published file before wiring them into your own code, as the naming is not documented in the excerpt.
Can I send OTP and verification codes with this package?
Yes, verification-code and lookup helpers are part of the package's advertised surface, so you can trigger OTP delivery without hand-rolling the Kavenegar endpoint. Be careful about the return contract though: if the wrapper collapses the provider response to a boolean, you lose the error code needed to distinguish a blacklisted number from exhausted credit. For login-critical OTP flows, log the raw provider response and treat any ambiguity as a failure rather than a success.
Does the package support Kavenegar lookup and template-based messages?
Lookup-style sending is one of the features the package lists, which matters because Kavenegar templates let you send pre-approved pattern messages with placeholder tokens instead of free text. That is the preferred route for OTP in Iran, since pattern messages are more reliably delivered than plain-text SMS. Check the method signature in the source to see whether tokens are passed as named parameters or an array before you build around it.
Can I send the same SMS to multiple recipients in one call?
Multi-recipient sending is listed as a supported feature, so you can pass several numbers to a single send call rather than looping. Kavenegar bills per recipient, so this is a convenience wrapper over one HTTP request, not a bulk-discount mechanism. Keep in mind that partial failures are possible and, without a documented per-recipient result contract, you should verify what the call actually returns for mixed-success batches.
Which Laravel and PHP versions does this Kavenegar package support?
The package states Laravel 4 and 5 support, which implies a PHP 5.6 through 7.x floor across its supported range. Both of those framework lines are end-of-life and no longer receive security fixes, so the integration effectively pins your application to an unsupported base. Check the illuminate/support and php constraints in the package composer.json before attempting to install it alongside a modern Laravel release, because Composer will usually refuse the resolution outright.
Does the package throw exceptions when Kavenegar returns an error code?
That is the single most important thing to verify, and it is not answered by the overview. Kavenegar frequently responds with HTTP 200 while signalling failure through a status code and message in the response body, covering bad keys, exhausted credit, blacklisted numbers, and invalid sender lines. A wrapper that treats any non-exception response as success will report healthy while messages silently fail, so inspect the facade's return type and add your own status check if it returns a boolean. The package ships no CI or test evidence, so you cannot rely on its own suite to confirm behaviour.
Does this package support queues, retries, or rate limiting?
No such behaviour is documented. Calls appear to be synchronous blocking HTTP requests issued directly from the facade, with no queue integration, retry policy, throttling, or idempotency key. For OTP traffic that means a slow Kavenegar response blocks your request cycle, and a transient network failure is a lost message. If you adopt it, wrap the calls in your own job and add retry and rate-limit logic around them, or accept the risk knowingly. The same gap applies to testing: there is no fake or test double, so you will need to bind a stub in the container yourself.
Should I use this package or Kavenegar's official PHP SDK for a new Laravel project?
For new work, prefer Kavenegar's official PHP SDK or a thin in-house client implementing a small SmsSender interface, and reserve this package for an existing Laravel 4 or 5 monolith that has already committed to Kavenegar. The package has no release cadence, no named maintainer, no CI, zero stars, and no visible security-response path, which makes it hard to defend in a design review even though it is trivial to install. Writing your own client costs a few engineering days but gives you retries, structured logging, and a testable contract. Separately, confirm with legal and security before any engineering time is spent, because an Iranian gateway raises sanctions, data-residency, and PII questions for organisations with US or EU nexus.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo