magic-systems-io / laravel-notifyre-sms
A Notifyre wrapper for laravel
0.2.5
2025-09-04 09:21 UTC
Requires
- php: ^8.3
- laravel/framework: ^12.20.0
Requires (Dev)
- laravel/pint: ^1.24.0
- mockery/mockery: ^1.6
- orchestra/testbench: ^10.6
- pestphp/pest: ^3.8
README
A comprehensive Laravel-native SMS package that integrates with Notifyre's SMS service. Send SMS directly, through Laravel notifications, or via REST API with database persistence and advanced features.
β¨ Features
- π Direct SMS Sending - Fast, simple SMS without notification overhead
- π Laravel Notifications - Full notification system with queuing and events
- π§ Multiple Drivers - SMS driver for production, log driver for testing
- ποΈ Clean Architecture - Driver-based design with separation of concerns
- π‘οΈ Error Handling - Comprehensive exception handling and validation
- π± CLI Support - Send SMS directly from Artisan commands
- π REST API - Full HTTP API with rate limiting and authentication
- πΎ Database Persistence - Store SMS messages and recipients in database
- β‘ Caching Support - Built-in caching for API responses
- π§ͺ Testing Ready - Log driver for development and testing
- βοΈ Flexible Configuration - Extensive configuration options
- π Advanced DTOs - Rich data transfer objects with Arrayable interface
- π·οΈ Recipient Types - Support for virtual mobile numbers, contacts, and groups
- π Message Tracking - Track SMS messages with unique IDs
π Quick Start
Installation
composer require magic-systems-io/laravel-notifyre-sms
Basic Setup
NOTIFYRE_DRIVER=log NOTIFYRE_API_KEY=your_api_key_here
Basic Usage
use MagicSystemsIO\Notifyre\DTO\SMS\Recipient; use MagicSystemsIO\Notifyre\DTO\SMS\RequestBody; use MagicSystemsIO\Notifyre\Enums\NotifyreRecipientTypes; // Direct SMS (fast) notifyre()->send(new RequestBody( body: 'Hello World!', recipients: [new Recipient(NotifyreRecipientTypes::MOBILE_NUMBER->value, '+1234567890')] )); // With sender notifyre()->send(new RequestBody( body: 'Your order has been shipped!', recipients: [new Recipient(NotifyreRecipientTypes::MOBILE_NUMBER->value, '+1234567890')], sender: '+1987654321' )); // Laravel notifications (full features) $user->notify(new WelcomeNotification());
Test Your Installation
php artisan sms:send --message="Hello from Notifyre!" --recipient="+1234567890"
π Documentation
π Full Documentation - Complete documentation index and navigation
Quick Links:
- Installation - How to install and configure the package
- Direct SMS - Send SMS immediately using the helper function
- Notifications - Send SMS through Laravel notifications
- Commands - Send SMS from the command line
- API Usage - Use the REST API endpoints
ποΈ Architecture
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β NotifyreService βββββΆβ DriverFactory βββββΆβ SMSDriver β
β (Direct SMS) β β β β LogDriver β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β
βΌ
ββββββββββββββββββββ
β NotifyreChannel β
β (Notifications) β
ββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββ
β HTTP Controllers β
β (REST API) β
ββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββ
β Database Models β
β (Persistence) β
ββββββββββββββββββββ
π§ Drivers
sms
- Sends real SMS via Notifyre APIlog
- Logs SMS to Laravel logs (for testing)
π API Endpoints
The package provides REST API endpoints for SMS operations:
POST /api/notifyre/sms
- Send SMS messagesGET /api/notifyre/sms
- List SMS messages (requires sender parameter)GET /api/notifyre/sms/{id}
- Get specific SMS message
π Requirements
- PHP 8.3+
- Laravel 12.20+
- Notifyre API account
π License
MIT License - see LICENSE.md for details.
π€ Contributing
See CONTRIBUTING.md for contribution guidelines.
π Support
For issues and questions:
- Check the documentation
- Review the examples
- Open an issue on GitHub
Built with β€οΈ for the Laravel community