PHP code example of mocean / laravel-mocean
1. Go to this page and download the library: Download mocean/laravel-mocean 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/ */
mocean / laravel-mocean example snippets
'providers' => [
Mocean\Laravel\MoceanServiceProvider::class,
]
'aliases' => [
'Mocean' => Mocean\Laravel\Facade\Facade::class,
]
//use configured mocean setting from Laravel IOC Container
$mocean = app('mocean');
$mocean->message()->send([
'mocean-to' => '60123456789',
'mocean-from' => 'MOCEAN',
'mocean-text' => 'Hello World'
]);
$mocean->using('second_account')->message()->send(...);
$mocean->using('third_account')->message()->send(...);
//by \Mocean\Client\Credentials\Basic class
$mocean->using(
new \Mocean\Client\Credentials\Basic('mocean_api_key', 'mocean_api_secret')
)->message()->send(...);
//by using array
$mocean->using([
'MOCEAN_API_KEY' => 'mocean_api_key',
'MOCEAN_API_SECRET' => 'mocean_api_secret'
])->message()->send(...);
use Mocean;
Mocean::message()->send(...);
Mocean::using(...)->message(...);
bash
php artisan vendor:publish --provider="Mocean\Laravel\MoceanServiceProvider"