I am working with Laravel error handling and want to send email from App::error when exception occurs.
Following code is working and I get emails
$data = array('exception' => $exception,'ip'=>$ip,'host'=>$host,'url'=>$url);
$details=['server'=>$server];
Mail::later(10,'emails.exception', $data, function($message) use($details)
{
$message->from('[email protected]');
$message->to('[email protected]')->subject('Error on '.$details['server']);
});
However, when I change from Mail::send to Mail::later(20, I get following error when exception occures
Error in exception handler: Array to string conversion (View: /app/views/emails/exception.blade.php) in /app/storage/views/1c8e0883061171a30b7f85d86c83370d:8
My email template is as follows
Client: {{$ip}}
Host: {{$host}}
URL: {{$url}}
Exception:
{{$exception}} - This is where the error is
$server
variable? – lukasgeiter