magic-systems-io / laravel-notifyre-sms
A Notifyre wrapper for laravel
Installs: 7
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/magic-systems-io/laravel-notifyre-sms
Requires
- php: ^8.3
- giggsey/libphonenumber-for-php: ^9.0
- laravel/framework: ^12.20.0
Requires (Dev)
- laravel/pint: ^1.24.0
- mockery/mockery: ^1.6
- orchestra/testbench: ^10.6
- pestphp/pest: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
- phpstan/phpstan: ^1.11
- phpunit/phpunit: ^12.3
README
A Laravel package for sending SMS messages through the Notifyre API. Provides direct SMS sending, Laravel notification integration, CLI commands, and REST API endpoints with optional database persistence.
Jumpstart
1) Install
composer require magic-systems-io/laravel-notifyre-sms
2) (Optional) Publish config
php artisan notifyre:publish-config
3) Configure .env
php artisan notifyre:publish-env
Then edit your .env
file:
NOTIFYRE_API_KEY=your_api_key_here NOTIFYRE_WEBHOOK_SECRET=your_webhook_secret_here # NOTIFYRE_LOG_LEVEL=debug # Optional: emergency|alert|critical|error|warning|notice|info|debug
4) (Optional) Publish migration
php artisan notifyre:publish-migration
5) Migrate (for persistence)
php artisan migrate
6) Send your first SMS
use MagicSystemsIO\Notifyre\DTO\SMS\Recipient; use MagicSystemsIO\Notifyre\DTO\SMS\RequestBody; use MagicSystemsIO\Notifyre\Enums\NotifyreRecipientTypes; notifyre()->send(new RequestBody( body: 'Hello World!', recipients: [new Recipient(NotifyreRecipientTypes::MOBILE_NUMBER->value, '+1234567890')] ));
Or via Artisan:
php artisan sms:send --message "Hello from Notifyre!" --recipient "+1234567890"
Endpoints (default prefix /api/notifyre
)
POST /api/notifyre/sms
— Send SMS (201 on acceptance)GET /api/notifyre/sms
— List local messages (requires sender on authenticated user)GET /api/notifyre/sms/{id}
— Get local messageGET /api/notifyre/sms/notifyre
— List via Notifyre API (proxy)GET /api/notifyre/sms/notifyre/{id}
— Get via Notifyre API (proxy)POST /api/notifyre/sms/webhook
— Delivery callback handler
Commands
php artisan sms:send
— Send SMSphp artisan sms:list
— List/filter SMS (see--help
)php artisan notifyre:publish*
— Publish config/env snippets
Logging
The package creates a dedicated log channel (notifyre
) that:
- Respects
APP_DEBUG
- defaults toinfo
in production,debug
in development - Can be customized via
NOTIFYRE_LOG_LEVEL
in.env
- Falls back to your app's
LOG_LEVEL
if set - Logs to
storage/logs/notifyre_sms.log
(or.log
files based on your default channel config)
Requirements
- PHP 8.3+
- Laravel 12.20+
- Notifyre API account (for
sms
driver)
Docs
See the full documentation: README.
License
MIT License — see LICENSE.
Contributing
See CONTRIBUTING .
Support
Troubleshooting
Provider not auto-discovered? If the package isn't working, manually register it in bootstrap/providers.php
:
return [ // Other Service Providers... MagicSystemsIO\Notifyre\Providers\NotifyreServiceProvider::class, ];
Made with ❤️ by Magic Systems