namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
use Notifiable;
/**
* Route notifications for the Nexmo channel.
*
* @return string
*/
public function routeNotificationForTelegram()
{
return $this->telegram_user_id;
}
}
/**
* Get the telegram representation of the notification.
*
* @param mixed $notifiable
* @return \Alexsoft\LaravelNotificationsTelegram\TelegramMessage
*/
public function toTelegram($notifiable)
{
$url = url('/invoice/' . $this->invoice->id);
return (new TelegramMessage)
->line('One of your invoices has been paid!')
->action('View Invoice', $url)
->line('Thank you for using our application!');
}
/**
* Get the telegram representation of the notification.
*
* @param mixed $notifiable
* @return \Alexsoft\LaravelNotificationsTelegram\TelegramMessage
*/
public function toTelegram($notifiable)
{
$url = url('/invoice/' . $this->invoice->id);
return (new TelegramMessage)
->error() // or success()
->line('Invoice could not be paid!')
->action('View Invoice', $url);
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.