beyondcode /
laravel-mailbox
| 1 | <?php |
||||||
| 2 | |||||||
| 3 | namespace BeyondCode\Mailbox\Drivers; |
||||||
| 4 | |||||||
| 5 | use BeyondCode\Mailbox\Facades\Mailbox; |
||||||
| 6 | use BeyondCode\Mailbox\InboundEmail; |
||||||
| 7 | use Illuminate\Mail\Events\MessageSent; |
||||||
| 8 | |||||||
| 9 | class Log implements DriverInterface |
||||||
| 10 | { |
||||||
| 11 | public function register() |
||||||
| 12 | { |
||||||
| 13 | app('events')->listen(MessageSent::class, [$this, 'processLog']); |
||||||
| 14 | } |
||||||
| 15 | |||||||
| 16 | public function processLog(MessageSent $event) |
||||||
| 17 | { |
||||||
| 18 | if (config('mail.driver') !== 'log' && config('mail.default') !== 'log') { |
||||||
| 19 | return; |
||||||
| 20 | } |
||||||
| 21 | |||||||
| 22 | $message = version_compare(app()->version(), '9.0.0', '>') ? $event->sent->toString() : $event->message; |
||||||
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||||||
| 23 | |||||||
| 24 | /** @var InboundEmail $modelClass */ |
||||||
| 25 | $modelClass = config('mailbox.model'); |
||||||
| 26 | $email = $modelClass::fromMessage($message); |
||||||
| 27 | |||||||
| 28 | Mailbox::callMailboxes($email); |
||||||
|
0 ignored issues
–
show
The method
callMailboxes() does not exist on BeyondCode\Mailbox\Facades\Mailbox. Since you implemented __callStatic, consider adding a @method annotation.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
| 29 | } |
||||||
| 30 | } |
||||||
| 31 |