composer create-project serefercelik/postaguverciniKomutu ile paketi yükleyiniz.php artisan vendor:publish --provider="SerefErcelik\PostaGuvercini\PostaGuverciniServiceProvider" --tag="config"komutu ile config dosyasını oluşturunuz./config/postaguvercini.phpdosyasının içerisindekiuser,passwordvecountry_codekısmını doldurunuz.
PostaGuvercini::sendMessage('Numaranızı başında 90 olmadan yazınız', 'Bu bir deneme mesajıdır.');şeklinde kullanabilirsiniz.
namespace App\Notifications;
use SerefErcelik\PostaGuvercini\Notifications\PostaGuverciniChannel;
use SerefErcelik\PostaGuvercini\Notifications\PostaGuverciniMessage;
use Illuminate\Notifications\Notification;
class ExampleNotification extends Notification
{
public function via($notifiable)
{
return [PostaGuverciniChannel::class];
}
public function toSmsApi($notifiable)
{
return (new PostaGuverciniMessage)
->content("Bu bir deneme Mesajıdır.");
}
}Notification özelliği eklenecek Model dosyasına aşağıdaki kodu eklemeyi unutmayınız.
public function routeNotificationForPostaGuvercini() {
return $this->phone; //Model içerisindeki telefon numarasının fieldi olacak.
}