1. Go to this page and download the library: Download schoolpalm/message-delivery library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use SchoolPalm\MessageDelivery\Facades\MessageDelivery;
MessageDelivery::sms()
->to('+250788123456')
->text('Your verification code is 1234')
->send();
MessageDelivery::email()
->to('[email protected]')
->subject('Welcome')
->text('Thank you for joining')
->send();
MessageDelivery::push()
->to('device-token-xyz')
->title('New Message')
->text('You have a new message')
->with(['deep_link' => '/messages/123'])
->send();
// In your AppServiceProvider or a dedicated service provider
use SchoolPalm\MessageDelivery\Notification\Contracts\RecipientResolver;
$this->app->bind(RecipientResolver::class, function ($app) {
return new \App\Resolvers\MyRecipientResolver();
});
MessageDelivery::sms()
->provider('egosms')
->to('+250788123456')
->text('Hello from EgoSMS')
->send();
MessageDelivery::sms()
->provider('twilio-sms')
->to('+250788123456')
->text('Hello from Twilio')
->send();
MessageDelivery::sms()
->provider('africas-talking')
->to('+250788123456')
->text('Hello from Africa\'s Talking')
->send();
MessageDelivery::whatsapp()
->provider('meta-whatsapp')
->to('+250788123456')
->text('Hello from Meta WhatsApp')
->send();
MessageDelivery::whatsapp()
->provider('twilio-whatsapp')
->to('+250788123456')
->text('Hello from Twilio WhatsApp')
->send();
MessageDelivery::push()
->provider('firebase')
->to('device-token')
->title('New Update')
->text('Your app has been updated')
->with(['click_action' => 'OPEN_ACTIVITY'])
->send();
MessageDelivery::email()
->provider('laravel-mail')
->to('[email protected]')
->subject('Welcome')
->text('Thank you for registering')
->send();
MessageDelivery::inApp()
->provider('database-notifications')
->to(['notifiable_type' => 'App\Models\User', 'notifiable_id' => 1])
->title('New Message')
->text('You have a new notification')
->send();
use SchoolPalm\MessageDelivery\Facades\MessageDelivery;
// Get a specific definition
$definition = MessageDelivery::definition('twilio-sms');
$fields = $definition->configurationFields();
// Get all definitions
$all = MessageDelivery::definitions();
// Get definitions for a channel
$smsProviders = MessageDelivery::providers('sms');
use SchoolPalm\MessageDelivery\Facades\MessageDelivery;
// Fields for a single provider as arrays
$fields = MessageDelivery::providerConfigurationFields('twilio-sms');
// Fields for a single provider as ConfigurationField objects
$fieldObjects = MessageDelivery::providerFieldObjects('twilio-sms');
// All providers, keyed by name → fields as arrays
$all = MessageDelivery::allProviderConfigurationFields();
// Providers for a channel → fields as arrays
$sms = MessageDelivery::providerConfigurationFieldsForChannel('sms');
$email = MessageDelivery::providerConfigurationFieldsForChannel('email');
// Look up a single field
$token = MessageDelivery::providerConfigurationField('twilio-sms', 'token');
// Flat settings map for DB seeding (provider.field => default)
$seed = MessageDelivery::providerSeedSettings();
// Scoped settings separating secrets from secured fields
$scoped = MessageDelivery::providerScopedSettings();
use SchoolPalm\MessageDelivery\Facades\MessageDelivery;
// Seed a tenant's Twilio SMS settings
$fields = MessageDelivery::providerConfigurationFields('twilio-sms');
$settings = [
'provider' => 'twilio-sms',
'channel' => 'sms',
'fields' => $fields,
'defaults' => MessageDelivery::providerSeedSettings(),
];
// Persist $settings into your own settings scope/storage here.