File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
src/Illuminate/Notifications/Messages Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,22 @@ public function line($line)
157
157
return $ this ->with ($ line );
158
158
}
159
159
160
+ /**
161
+ * Add a line of text to the notification if the given condition is true.
162
+ *
163
+ * @param bool $boolean
164
+ * @param mixed $line
165
+ * @return $this
166
+ */
167
+ public function lineIf ($ boolean , $ line )
168
+ {
169
+ if ($ boolean ) {
170
+ return $ this ->line ($ line );
171
+ }
172
+
173
+ return $ this ;
174
+ }
175
+
160
176
/**
161
177
* Add lines of text to the notification.
162
178
*
@@ -172,6 +188,22 @@ public function lines($lines)
172
188
return $ this ;
173
189
}
174
190
191
+ /**
192
+ * Add lines of text to the notification if the given condition is true.
193
+ *
194
+ * @param bool $boolean
195
+ * @param iterable $lines
196
+ * @return $this
197
+ */
198
+ public function linesIf ($ boolean , $ lines )
199
+ {
200
+ if ($ boolean ) {
201
+ return $ this ->lines ($ lines );
202
+ }
203
+
204
+ return $ this ;
205
+ }
206
+
175
207
/**
176
208
* Add a line of text to the notification.
177
209
*
You can’t perform that action at this time.
0 commit comments