Laravel Notifications
Barta provides a barta notification channel.
Creating a Notification
Section titled “Creating a Notification”use Illuminate\Notifications\Notification;use Larament\Barta\Notifications\BartaMessage;
class OrderShipped extends Notification{ public function via($notifiable): array { return ['barta']; }
public function toBarta($notifiable): BartaMessage { return new BartaMessage( "Hi {$notifiable->name}, your order shipped!" ); }}Routing Notifications
Section titled “Routing Notifications”Add to your model:
public function routeNotificationForBarta($notification): string{ return $this->phone;}Sending
Section titled “Sending”$user->notify(new OrderShipped());Custom Driver per Notification
Section titled “Custom Driver per Notification”public function bartaDriver(): string{ return 'mimsms';}