1 | <?php |
||
7 | class SimpleMessage |
||
8 | { |
||
9 | /** |
||
10 | * The "level" of the notification (info, success, error). |
||
11 | * |
||
12 | * @var string |
||
13 | */ |
||
14 | public $level = 'info'; |
||
15 | |||
16 | /** |
||
17 | * The subject of the notification. |
||
18 | * |
||
19 | * @var string |
||
20 | */ |
||
21 | public $subject; |
||
22 | |||
23 | /** |
||
24 | * The "intro" lines of the notification. |
||
25 | * |
||
26 | * @var array |
||
27 | */ |
||
28 | public $introLines = []; |
||
29 | |||
30 | /** |
||
31 | * The "outro" lines of the notification. |
||
32 | * |
||
33 | * @var array |
||
34 | */ |
||
35 | public $outroLines = []; |
||
36 | |||
37 | /** |
||
38 | * The text / label for the action. |
||
39 | * |
||
40 | * @var string |
||
41 | */ |
||
42 | public $actionText; |
||
43 | |||
44 | /** |
||
45 | * The action URL. |
||
46 | * |
||
47 | * @var string |
||
48 | */ |
||
49 | public $actionUrl; |
||
50 | |||
51 | /** |
||
52 | * Indicate that the notification gives information about a successful operation. |
||
53 | * |
||
54 | * @return $this |
||
55 | */ |
||
56 | public function success() |
||
62 | |||
63 | /** |
||
64 | * Indicate that the notification gives information about an error. |
||
65 | * |
||
66 | * @return $this |
||
67 | */ |
||
68 | public function error() |
||
74 | |||
75 | /** |
||
76 | * Set the "level" of the notification (success, error, etc.). |
||
77 | * |
||
78 | * @param string $level |
||
79 | * @return $this |
||
80 | */ |
||
81 | 1 | public function level($level) |
|
87 | |||
88 | /** |
||
89 | * Set the subject of the notification. |
||
90 | * |
||
91 | * @param string $subject |
||
92 | * @return $this |
||
93 | */ |
||
94 | public function subject($subject) |
||
100 | |||
101 | /** |
||
102 | * Add a line of text to the notification. |
||
103 | * |
||
104 | * @param \Illuminate\Notifications\Action|string $line |
||
105 | * @return $this |
||
106 | */ |
||
107 | public function line($line) |
||
111 | |||
112 | /** |
||
113 | * Add a line of text to the notification. |
||
114 | * |
||
115 | * @param \Illuminate\Notifications\Action|string|array $line |
||
116 | * @return $this |
||
117 | */ |
||
118 | 1 | public function with($line) |
|
130 | |||
131 | /** |
||
132 | * Format the given line of text. |
||
133 | * |
||
134 | * @param string|array $line |
||
135 | * @return string |
||
136 | */ |
||
137 | 1 | protected function formatLine($line) |
|
145 | |||
146 | /** |
||
147 | * Configure the "call to action" button. |
||
148 | * |
||
149 | * @param string $text |
||
150 | * @param string $url |
||
151 | * @return $this |
||
152 | */ |
||
153 | public function action($text, $url) |
||
160 | |||
161 | /** |
||
162 | * Get an array representation of the message. |
||
163 | * |
||
164 | * @return array |
||
165 | */ |
||
166 | 1 | public function toArray() |
|
177 | } |
||
178 |