Shoutout messaging library for Laravel
- PHP 8.0+
- Laravel 8.0+
- Install the package by running this command in your terminal/cmd:
composer require dasun4u/laravel-shoutout-messaging
- Import config file by running this command in your terminal/cmd and change the configs accordingly
php artisan vendor:publish --provider="Dasun4u\LaravelShoutoutMessaging\ShoutoutServiceProvider"
- Change the imported config file (
config/shoutout_message.php
) accordingly
'api_key' => 'XXXXXXXXX.XXXXXXXXX.XXXXXXXXX',
'sms_source' => 'ShoutDEMO',
'email_source' => 'ShoutDEMO <shoutdemo@getshoutout.com>',
- Send SMS
use Dasun4u\LaravelShoutoutMessaging\Shoutout;
$shoutout = new Shoutout();
$destinations = ["+94712345678"]; // Multiple numbers can add as array
$content = "Test SMS";
$response = $shoutout->sendSMS($destinations, $content);
- Send Email
use Dasun4u\LaravelShoutoutMessaging\Shoutout;
$shoutout = new Shoutout();
$destinations = ["test@test.com"]; // Multiple numbers can add as array
$subject = "Test Subject";
$content = "<h1>Test html content</h1>"; // Html body
$response = $shoutout->sendEmail($destinations, $subject, $content);
- Get Response Data
$response_body = $response->getBody(); // Get response
$response_body = json_decode($response->getBody(), true); // Get response as associative array
$response_status_code = $response->getStatusCode(); // Get status code
This project is licensed under the MIT License - see the LICENSE file for details