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
Laravel Sms Client

Laravel Sms Client Laravel Package

asanak/laravel-sms-client

Laravel package for sending SMS via Asanak API. Supports simple send, P2P messages, OTP templates, and message status reports. Includes config publishing, .env credentials, optional logging, and auto-registered service provider and facade.

View on GitHub
Deep Wiki
Context7

A modern Laravel SMS client for sending and reporting messages via REST API

Frequently asked questions about Laravel Sms Client
How do I install and configure the Laravel SMS Client package for Asanak API?
Run `composer require asanak/laravel-sms-client`, then publish the config with `php artisan vendor:publish --tag=asanak-config`. Add your Asanak credentials to `.env` under `ASANAK_SMS_USERNAME`, `ASANAK_SMS_PASSWORD`, and `ASANAK_SMS_BASE_URL`. The package auto-registers the provider and facade, so no manual bootstrapping is needed.
Does this package support sending bulk SMS or peer-to-peer (P2P) messages?
Yes, the package supports both bulk and P2P messages. Use the `p2p()` method to send multiple messages with different sources, destinations, and texts in a single API call. This is useful for campaigns or multi-recipient notifications.
Can I send OTPs or templated SMS messages using this package?
Absolutely. Use the `template()` method to send SMS with predefined templates. Pass the `template_id` and an array of parameters (e.g., `['code' => '12345']`) to dynamically populate the template. This is ideal for authentication flows or transactional alerts.
How do I check the status of sent SMS messages?
Use the `msgStatus()` method to fetch the delivery status of messages by passing an array of message IDs. This is useful for tracking failed deliveries or confirming successful sends in critical workflows like OTP verification.
Is this package compatible with Laravel 10 or 11?
The package is designed for Laravel 10 and supports Laravel 11. To avoid compatibility issues, pin your Laravel version in `composer.json` (e.g., `^10.0` or `^11.0`). Always check the package’s GitHub for updates if you’re using a newer Laravel release.
Can I send SMS messages asynchronously using queues?
Yes, the package includes a `SendSmsJob` class for queueing SMS sends. Dispatch the job with `SendSmsJob::dispatch($data)` in your controller. Ensure your queue worker (e.g., Laravel Horizon or Redis) is running to process jobs asynchronously.
How do I enable logging for SMS activities?
Set `ASANAK_SMS_LOG=true` in your `.env` file. Logs will be stored in the `storage/logs/sms.log` file by default. This helps with debugging and auditing SMS-related operations in your application.
What if I need to use a different SMS provider (e.g., Kavenegar, Clickatell) instead of Asanak?
The package is built to be provider-agnostic. You can extend the base `Provider` class or implement the `ProviderInterface` to create a custom adapter for other SMS gateways. Check the package’s GitHub for examples or documentation on extending functionality.
How do I handle failed SMS sends or retries in production?
Failed jobs are automatically logged in Laravel’s `failed_jobs` table. Use Laravel Horizon or Supervisor to monitor and retry failed jobs. For critical messages, implement retry logic with exponential backoff in the `SendSmsJob` class.
Are there any alternatives to this package for Laravel SMS integration?
Yes, alternatives include `laravel-notification-channels/sms` (for Laravel Notifications) or provider-specific packages like `kavenegar/laravel-notification-channel-kavenegar`. However, this package is tailored for Asanak’s API, offering direct methods for P2P, templates, and status checks without extra abstraction layers.
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.
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
anil/file-picker
broqit/fields-ai