- How do I install Kavenegar Laravel in my Laravel project?
- Run `composer require ariaieboy/kavenegar-laravel` in your project directory. Then register the service provider and facade in `config/app.php` under the `providers` and `aliases` arrays, respectively. Finally, publish the config file using `php artisan vendor:publish` and select the Kavenegar option.
- Which Laravel versions does this package support?
- This package supports Laravel 4 through 10. However, it assumes PHP 8.x and lacks explicit version constraints, so test thoroughly in your environment, especially for newer Laravel releases.
- How do I configure the API key for Kavenegar?
- Publish the config file with `php artisan vendor:publish`, then set your API key in `config/kavenegar.php` under the `apikey` key. Alternatively, you can use environment variables like `KAVENEGAR_API_KEY` if you configure the package to read from `.env`.
- Can I use this package with Laravel Notifications?
- No, this package does not natively support Laravel’s Notification system. You’ll need to manually integrate it by creating a custom notification channel or service class that uses the Kavenegar facade.
- Does this package support sending SMS asynchronously?
- No, the package does not include queue support. To send SMS asynchronously, you’ll need to wrap the Kavenegar facade calls in a `ShouldQueue` job or implement a custom queueable service class.
- How do I handle failed SMS deliveries?
- The package does not include built-in retry logic or logging for failed SMS deliveries. You’ll need to manually implement error handling, such as wrapping the facade calls in a try-catch block and logging errors using Laravel’s logging system.
- Is this package actively maintained?
- The last release was in March 2024, but the package has low adoption and no visible CI/CD or dependency updates. Consider evaluating alternatives like `spatie/laravel-sms-notifications` for better maintenance and features.
- Can I use this package with multiple SMS providers?
- No, this package is specifically for Kavenegar. To support multiple providers, you’d need to abstract the SMS logic behind an interface and implement separate services for each provider.
- What are the risks of using this package in production?
- Key risks include lack of queue support, no retry logic, minimal error handling, and no built-in monitoring for failed deliveries. Additionally, the API key is stored in plaintext in `.env`, and there’s no input validation for SMS payloads, which could pose security risks if used with user-provided data.
- Are there any alternatives to this package for Laravel SMS integration?
- Yes, consider `spatie/laravel-sms-notifications` for a more feature-rich solution with built-in queue support, retries, and Laravel Notification channel integration. Alternatively, you could create a custom HTTP client for Kavenegar with added reliability features.