forked from miguel456/rbrecruiter
Miguel Nogueira
4eb115d165
This reverts pull request #6. > This pull request applies code style fixes from an analysis carried out by [StyleCI](https://bitbucket.styleci.io). > > For more information, click [here](https://bitbucket.styleci.io/analyses/a2Jl7D).
50 lines
771 B
PHP
50 lines
771 B
PHP
<?php
|
|
|
|
|
|
namespace App\Traits;
|
|
|
|
|
|
use App\Facades\Options;
|
|
|
|
trait Cancellable
|
|
{
|
|
|
|
public function chooseChannelsViaOptions()
|
|
{
|
|
$channels = [];
|
|
|
|
if (Options::getOption('enable_slack_notifications') == 1)
|
|
{
|
|
array_push($channels, 'slack');
|
|
}
|
|
elseif(Options::getOption('enable_email_notifications') == 1)
|
|
{
|
|
array_push($channels, 'email');
|
|
}
|
|
|
|
return $channels;
|
|
}
|
|
|
|
public function channels()
|
|
{
|
|
return ['mail'];
|
|
}
|
|
|
|
public function via($notifiable)
|
|
{
|
|
if ($this->optOut($notifiable))
|
|
{
|
|
return [];
|
|
}
|
|
|
|
return $this->channels();
|
|
}
|
|
|
|
|
|
public function optOut($notifiable)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
}
|