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.
Pros:
MailChannel, DatabaseChannel), enabling modularity and extensibility.sent, failed hooks) for observability or retries.Cons:
routeNotificationForSms).Notification classes can be extended with minimal effort..env is standard but should be audited for compliance (e.g., secret scanning).Mail, Database, etc., but lacks advanced features (e.g., SMS templates).composer require erfanhemmati/kavenegar-laravel-notification.config/app.php.config/services.php with Kavenegar credentials.Notification classes with KavenegarChannel:
public function via($notifiable) {
return [KavenegarChannel::class]; // Add alongside other channels if needed
}
routeNotificationForSms() in Notifiable models (e.g., User):
public function routeNotificationForSms() {
return $this->phone_number;
}
MockHttp or a custom facade).shouldQueue()) if not updated.failed_jobs table for retries.config/services.php and .env.shouldQueue() for background processing.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Kavenegar API downtime | SMS notifications fail silently. | Fallback to email or in-app alerts. |
| Invalid sender number | SMS rejected by Kavenegar. | Validate sender number in config. |
| Rate limit exceeded | Requests thrott |
How can I help you explore Laravel packages today?