On production server i would like to send myself an email every time an error ocurres. I'm now sending a basic mail but i would like to attach the rendered basic (orange) error page as a attached html file.
Any idea how to do that?
This is what i currently have:
App::error(function(Exception $exception, $code)
{
Log::error($exception);
$data = array('exception' => $exception);
Mail::send('emails.error', $data, function($message)
{
$message->from(Config::get('app.debug_email'));
$message->to(Config::get('app.debug_email'))->subject(Config::get('app.client_name') . ' Error');
});
if (!Config::get('app.debug')) {
return Response::view('errors.index', $code);
}
});