Weave Code
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 Notification

Kavenegar Laravel Notification Laravel Package

erfanhemmati/kavenegar-laravel-notification

Laravel 5.3/5.4 notification channel for sending SMS via Kavenegar. Configure your API key (and optional sender) in services.php, add the service provider, then use KavenegarChannel in notifications and routeNotificationForSms to supply the recipient number.

View on GitHub
Deep Wiki
Context7

laravel notificatiion channel for Kavenegar

Frequently asked questions about Kavenegar Laravel Notification
Does this package work with Laravel 8.x or 9.x? If not, what’s the workaround?
This package is designed for Laravel 5.3/5.4 only. For newer Laravel versions, you’d need to fork the repository, update dependencies (e.g., `illuminate/notifications`), and test compatibility. Check the GitHub issues for potential community forks or consider alternatives like `notifications-channels/kavenegar`.
How do I configure the Kavenegar API key and sender number?
Add your API key and optional sender number to `.env` as `KAVENEGAR_API_KEY` and `KAVENEGAR_SENDER`. Then, define them in `config/services.php` under the `kavenegar` array. The package reads these values automatically during notification dispatch.
Can I send SMS notifications to multiple recipients at once?
No, this package sends SMS notifications one recipient at a time via the `routeNotificationForSms()` method. For bulk SMS, you’d need to loop through recipients manually or explore Kavenegar’s API directly for batch operations.
How do I test SMS notifications in CI/CD without hitting rate limits?
Mock Kavenegar’s API responses in your tests using Laravel’s HTTP client or a package like `mockery`. Override the `KavenegarChannel` to return a fake response instead of making real API calls. Example: Use `Http::fake()` in PHPUnit tests.
What happens if the SMS fails to send? Are there retries or fallbacks?
The package doesn’t include built-in retries or fallbacks. Failed SMS deliveries will trigger Laravel’s default notification failure handling. For retries, extend the `KavenegarChannel` class or use Laravel’s `NotificationFailed` event to implement custom logic, like email fallbacks.
Is there a way to use SMS templates (e.g., predefined messages) with this package?
No, this package only supports raw SMS text via the `toSMS()` method. For templates, you’d need to integrate Kavenegar’s API directly or extend the channel to support template IDs. Check Kavenegar’s [documentation](http://kavenegar.com) for template features.
How do I log SMS delivery status (success/failure) for monitoring?
Laravel’s notification system logs failures by default, but you’ll need to manually log successes. Extend `KavenegarChannel` to log responses using Laravel’s `Log` facade or a monitoring tool like Sentry. Example: `Log::info('SMS sent to ' . $phone, ['status' => $response->status])`.
Does this package support sending SMS to international numbers?
Yes, but Kavenegar’s sender number must be validated for international use. Ensure your sender number is configured to support global recipients. Test with a few numbers first, as regional restrictions may apply.
What are the alternatives to this package for Laravel SMS notifications?
Alternatives include `notifications-channels/kavenegar` (updated for newer Laravel), `spatie/laravel-sms-notifications` (supports multiple providers), or direct Kavenegar API integration. Choose based on Laravel version support and features like templates or scheduling.
How do I handle rate limits or API throttling from Kavenegar?
Kavenegar’s rate limits are documented [here](http://kavenegar.com). Implement exponential backoff in your `KavenegarChannel` by catching HTTP exceptions (e.g., `429 Too Many Requests`) and retrying with delays. Use Laravel’s `retry-after` logic or a queue worker for throttled requests.
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.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope