1. Go to this page and download the library: Download alhelwany/laravel-mtn 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 Alhelwany\LaravelMtn\Enums\Lang;
use Alhelwany\LaravelMtn\Interfaces\MTNNotification;
use Illuminate\Notifications\Notification;
use Alhelwany\LaravelMtn\Channels\MTNChannel;
class MyNotification extends Notification implements MTNNotification
{
public function via(object $notifiable): array
{
return [MTNChannel::class];
}
public function toText(): string
{
return "Hello";
}
public function getLang(): Lang
{
return Lang::EN;
}
}
use Illuminate\Database\Eloquent\Model;
use Alhelwany\LaravelMtn\Interfaces\MTNNotifiable;
class User extends Model implements MTNNotifiable
{
public function getPhone(): string
{
return $this->phone;
}
}