4
4
5
5
use Exception ;
6
6
use Illuminate \Support \Arr ;
7
+ use MailThief \Support \MailThiefCollection ;
7
8
8
9
class Message
9
10
{
@@ -38,12 +39,12 @@ public function __construct($view, $data)
38
39
{
39
40
$ this ->view = $ view ;
40
41
$ this ->data = $ data ;
41
- $ this ->to = collect ();
42
- $ this ->cc = collect ();
43
- $ this ->bcc = collect ();
44
- $ this ->reply_to = collect ();
45
- $ this ->attachments = collect ();
46
- $ this ->headers = collect ();
42
+ $ this ->to = new MailThiefCollection ();
43
+ $ this ->cc = new MailThiefCollection ();
44
+ $ this ->bcc = new MailThiefCollection ();
45
+ $ this ->reply_to = new MailThiefCollection ();
46
+ $ this ->attachments = new MailThiefCollection ();
47
+ $ this ->headers = new MailThiefCollection ();
47
48
}
48
49
49
50
public function __call ($ name , $ arguments )
@@ -79,9 +80,9 @@ public function subject($subject)
79
80
public function to ($ address , $ name = null , $ override = false )
80
81
{
81
82
if ($ override ) {
82
- $ this ->to = collect ();
83
+ $ this ->to = new MailThiefCollection ();
83
84
}
84
-
85
+
85
86
if (! is_array ($ address )) {
86
87
$ address = $ name ? [$ address => $ name ] : [$ address ];
87
88
}
@@ -130,7 +131,7 @@ public function from($address, $name = null)
130
131
$ address = $ name ? [$ address => $ name ] : [$ address ];
131
132
}
132
133
133
- $ this ->from = collect ($ address );
134
+ $ this ->from = new MailThiefCollection ($ address );
134
135
135
136
return $ this ;
136
137
}
@@ -141,7 +142,7 @@ public function sender($address, $name = null)
141
142
$ address = $ name ? [$ address => $ name ] : [$ address ];
142
143
}
143
144
144
- $ this ->sender = collect ($ address );
145
+ $ this ->sender = new MailThiefCollection ($ address );
145
146
146
147
return $ this ;
147
148
}
0 commit comments