1. Go to this page and download the library: Download abdulmatinsanni/api-x 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/ */
abdulmatinsanni / api-x example snippets
...
class User extends Model
{
use Notifiable;
public function routeNotificationForSmartSMS($notification)
{
return $this->phone_column;
}
}
...
use AbdulmatinSanni\APIx\APIxMessage;
use AbdulmatinSanni\APIx\Channels\SmartSMSChannel;
class DemoNotification extends Notification
{
use Queueable;
...
public function via($notifiable)
{
return [SmartSMSChannel::class];
}
...
public function toSmartSMS($notifiable)
{
return (new APIxMessage())
->from($this->from)
->message($this->message);
}
}
...
public class NotificationsController extends Controller
{
public function notify()
{
$user = User::firstOrFail();
$user->notify(new DemoNotification("SarahFound", "Hi, you are invited to our seminar!!!!!"));
}
}