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