| Total Complexity | 13 |
| Total Lines | 111 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class NotificationService |
||
| 8 | { |
||
| 9 | public $user; |
||
| 10 | |||
| 11 | public $subject; |
||
| 12 | |||
| 13 | public $content; |
||
| 14 | |||
| 15 | public $link; |
||
| 16 | |||
| 17 | public $link_label; |
||
| 18 | |||
| 19 | public $data; |
||
| 20 | |||
| 21 | public $template = 'laravel-helper::mail.notification'; |
||
| 22 | |||
| 23 | public $cc; |
||
| 24 | |||
| 25 | public $bcc; |
||
| 26 | |||
| 27 | public $attachments; |
||
| 28 | |||
| 29 | public function __construct($identifier, $column = 'id') |
||
| 30 | { |
||
| 31 | $this->user = config('helper.models.user')::where($column, $identifier)->firstOrFail(); |
||
| 32 | } |
||
| 33 | |||
| 34 | public static function make($identifier) |
||
| 37 | } |
||
| 38 | |||
| 39 | public function subject($subject) |
||
| 40 | { |
||
| 41 | $this->subject = $subject; |
||
| 42 | |||
| 43 | return $this; |
||
| 44 | } |
||
| 45 | |||
| 46 | public function message($content) |
||
| 47 | { |
||
| 48 | $this->content = $content; |
||
| 49 | |||
| 50 | return $this; |
||
| 51 | } |
||
| 52 | |||
| 53 | public function link($link) |
||
| 54 | { |
||
| 55 | $this->link = $link; |
||
| 56 | |||
| 57 | return $this; |
||
| 58 | } |
||
| 59 | |||
| 60 | public function link_label($link_label) |
||
| 61 | { |
||
| 62 | $this->link_label = $link_label; |
||
| 63 | |||
| 64 | return $this; |
||
| 65 | } |
||
| 66 | |||
| 67 | public function data($data) |
||
| 68 | { |
||
| 69 | $this->data = $data; |
||
| 70 | |||
| 71 | return $this; |
||
| 72 | } |
||
| 73 | |||
| 74 | public function template($template) |
||
| 75 | { |
||
| 76 | $this->template = $template; |
||
| 77 | |||
| 78 | return $this; |
||
| 79 | } |
||
| 80 | |||
| 81 | public function attachments($attachments) |
||
| 82 | { |
||
| 83 | $this->attachments = $attachments; |
||
| 84 | |||
| 85 | return $this; |
||
| 86 | } |
||
| 87 | |||
| 88 | public function cc(array $cc) |
||
| 89 | { |
||
| 90 | $this->cc = $cc; |
||
| 91 | |||
| 92 | return $this; |
||
| 93 | } |
||
| 94 | |||
| 95 | public function bcc(array $bcc) |
||
| 96 | { |
||
| 97 | $this->bcc = $bcc; |
||
| 98 | |||
| 99 | return $this; |
||
| 100 | } |
||
| 101 | |||
| 102 | public function send() |
||
| 118 | } |
||
| 119 | } |
||
| 120 | } |
||
| 121 |