1. Go to this page and download the library: Download mmockelyn/laravel-ovh-sms 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/ */
namespace App\Notifications;
use Illuminate\Notifications\Channels\OvhSmsChannel;
use Illuminate\Notifications\Messages\OvhSmsMessage;
use Illuminate\Notifications\Notification;
class ExampleNotification extends Notification
{
/**
* Notification via OvhSmsChannel.
*/
public function via($notifiable)
{
return [OvhSmsChannel::class];
}
/**
* Your notification must implements "toOvh()"
*/
public function toOvh($notifiable)
{
return (new OvhSmsMessage('A new invoice was paid! Amount: $9.00'));
}
}
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
use Notifiable;
/**
* Returns the user's phone number.
*/
public function routeNotificationForOvhSms()
{
return $this->phone; // Ex: +33611223344
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.