1. Go to this page and download the library: Download 101media/bird 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/ */
101media / bird example snippets
use Media101\Bird\Services\Contacts\ContactManager;
$contacts = ContactManager::get(); // Retrieve all contacts with default settings
namespace App\Notifications;
use Media101\Bird\Services\Contacts\BirdContact;
use Media101\Bird\Services\Notifications\SMS\SMSMessage;
class OrderReceived
{
public function __construct(
private string $content
) {}
public function via($notifiable): array
{
return [SMSChannel::class];
}
public function toSMS(User $notifiable): array
{
// The phone number must have a country code appended.
$contact = (new BirdContact())->phone($notifiable->phone_number);
return (new SMSMessage())
->to($contact)
->type(SMSType::TEXT)
->text($this->content);
}
}
$user->notify(new OrderReceived('Your order has been received'));