I'm currently using Mailtrap to send test emails. I would like to override Illuminate\Mail\Mailer.php -> send() method. How can I do this in Laravel 12? This is what I have so far:
namespace App\Mail;
use Illuminate\Mail\Mailer as BaseMailer;
use Override;
final class Mailer extends BaseMailer
{
#[Override]
public function send($view, array $data = [], $callback = null)
{
logger()->channel('mailsender')->info($data);
return parent::send($view, $data, $callback);
}
}
Mailer::macro('name', function () ...but those seem to be your own options.