- How do I install lbhurtado/sms in a Laravel app?
- Install it with Composer using composer require lbhurtado/sms. Then publish the package configuration, typically with php artisan vendor:publish, and set your default driver and gateway credentials in config/sms.php. Laravel package auto-discovery may register the service provider; if not, follow the README's provider registration instructions.
- How do I send an SMS message with lbhurtado/sms?
- Compose a message through the package's SMS API, select the configured default driver or a named driver, and dispatch it to the recipient. The package keeps provider-specific payloads behind the driver interface, so your application code does not need to change when you switch gateways. See the README for exact method names and driver-specific options.
- How do I configure multiple SMS drivers or gateways?
- Define available senders or drivers and their credentials in config/sms.php, then choose a default driver for normal sends. You can select a specific driver at send time when a message needs a different gateway. Keep each gateway's credentials in environment variables referenced by the config.
- Does lbhurtado/sms work with Laravel notifications?
- Yes. The package is designed to integrate with Laravel notifications, so you can deliver SMS alerts alongside mail and database notifications. You can also queue the notification if your notification implements ShouldQueue. Confirm the exact notification channel class or name in the package docs.
- Can lbhurtado/sms send SMS messages through queues?
- Yes, it integrates with Laravel queues, so SMS notifications or jobs can be dispatched asynchronously. Configure a queue connection and run a worker, then dispatch your SMS through a queued notification or job. This avoids delaying web requests when a gateway is slow.
- How do I create a custom SMS driver for lbhurtado/sms?
- Implement the package's driver contract or interface and register the driver in config/sms.php. Keep provider-specific HTTP calls and response mapping inside the driver, then select it as the default or per-message driver. The framework-agnostic core is intended to make extension possible without changing application code.
- Can I use lbhurtado/sms outside Laravel?
- Yes. The overview states the core is framework-agnostic and usable outside Laravel, while Laravel-specific integrations cover notifications and queues. You can use the SMS abstraction in other PHP applications by wiring the core components and configuration yourself. Check the docs for the supported standalone setup.
- Which Laravel versions does lbhurtado/sms support and is it maintained?
- The provided context does not state which Laravel versions are supported or how actively the package is maintained. Check Packagist and the repository's composer.json for version constraints, releases, and recent commits before adopting it. If maintenance is uncertain, pin a tested version or isolate it behind your own SMS interface.
- How do I test SMS sending and keep credentials safe in production?
- Use a non-production SMS driver or mock the package's driver contract in tests so requests never hit a real gateway. Keep provider credentials in environment variables referenced by config/sms.php, and never commit them. In production run config:cache and php artisan queue:work if sending via queued notifications. The overview does not document a built-in fake, so verify the README for a log or fake driver.
- What are alternatives to lbhurtado/sms for sending SMS in Laravel?
- Alternatives include Laravel's notification system with a custom or provider-specific SMS channel, provider SDKs such as Twilio or Vonage packages, and other driver-based SMS abstractions. Choose lbhurtado/sms if you want a unified Laravel API with configurable drivers and notification or queue integration. Compare maintenance status, supported Laravel versions, and available drivers before adopting any package.