jadessoriano/laravel-mobivate-sdk

Mobivate SDK using Laravel PHP

0.2.1 2025-04-20 02:20 UTC

This package is auto-updated.

Last update: 2025-04-20 02:22:41 UTC


README

Mobivate SDK for Laravel

Mobivate SDK for Laravel

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This package uses jadessoriano/mobivate-sdk-php

Installation

You can install the package via composer:

composer require jadessoriano/laravel-mobivate-sdk

You can publish the config file with:

php artisan vendor:publish --provider="Jadessoriano\LaravelMobivate\LaravelMobivateServiceProvider" --tag="mobivate-sdk-config"

This is the contents of the published config file:

return [
    'api_key' => env('MOBIVATE_API_KEY'),
    'originator' => env('MOBIVATE_ORIGINATOR'),
];

Send Single SMS Message

use Mobivate;

Mobivate::sendSingle(
    recipient: '6xxxxxxxxxxx',
    body: 'This is a test message.',
    originator: '6xxxxxxxxxxx',  // Optional: defaults to config value if not provided
    reference: 'sample',         // Optional: defaults to null if not provided
    campaignId: '1-xxx'          // Optional: defaults to null if not provided
);

Send Batch SMS Message

use Mobivate;

/**
 * Note: The schedule date time (for later delivery) is optional, defaults to null if not provided.
 */
Mobivate::sendBatch(
    messages: [
        new BatchMessageItem(
            originator: 'Test', // Optional: defaults to config value if not provided
            recipient: '44700011122',
            text: 'This is a test message'
        )
    ],
    scheduleDateTime: new DateTime('+5 minutes', new DateTimeZone('Asia/Manila'))
);

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.