I updated my application from 5 to 5.2. Now when I call Mail::send() it return an exception Class mailer does not exist.
Mail::send('emails.mail', ['data' => $content], function ($m) use ($to, $subject,$toname) {
$m->to($to, $toname)->subject($subject);
});
When I open Illuminate\Support\Facades\Mail class there is only one function
protected static function getFacadeAccessor()
{
return 'mailer';
}
Please help. If anyone have any idea
Yes, I found the solution
just put Illuminate\Mail\MailServiceProvider::class,
in app.php providers
Sometimes php artisan config:clear
must be run in order to get rid of that kind of errors ("Class mailer does not exist").
I've migrated my project 1:1 (code, config, vhost) from old laptop to new one (Windows->Ubuntu) and I couldn't run the app without clearing config's cache.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With