Integrate Mail, Nexmo and Slack notifications into Cachet
This commit is contained in:
@@ -15,11 +15,19 @@ use AltThree\Validator\ValidatingTrait;
|
||||
use CachetHQ\Cachet\Presenters\SubscriberPresenter;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use McCool\LaravelAutoPresenter\HasPresenter;
|
||||
|
||||
/**
|
||||
* This is the subscriber model.
|
||||
*
|
||||
* @author Joseph Cohen <joe@alt-three.com>
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
*/
|
||||
class Subscriber extends Model implements HasPresenter
|
||||
{
|
||||
use ValidatingTrait;
|
||||
use Notifiable, ValidatingTrait;
|
||||
|
||||
/**
|
||||
* The attributes that should be casted to native types.
|
||||
@@ -145,6 +153,26 @@ class Subscriber extends Model implements HasPresenter
|
||||
return str_random(42);
|
||||
}
|
||||
|
||||
/**
|
||||
* Route notifications for the Nexmo channel.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function routeNotificationForNexmo()
|
||||
{
|
||||
return $this->phone_number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Route notifications for the Slack channel.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function routeNotificationForSlack()
|
||||
{
|
||||
return $this->slack_webhook_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the presenter class.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user