mercredi 6 avril 2016

Mail The Error In Laravel 5

It could be a possible duplicate.but i have no repo scores here so i cant comment to ask about my specific problem. I want to send mail to a email whenever any kind of error occurs.till now i am working on development environment. to accomplish this I used the code from here but when implemented that code in app/Exceptions/Handler.php. but when an Error is occurs, it niether displays errror nor sends mail.My code is Below :

  public function report(Exception $e)
    {

     if ($e instanceof \Exception) {
        //dd($e->getLine()); <-- gives output 
    // emails.exception is the template of your email
    // it will have access to the $error that we are passing below
    $mail = Mail::send('emails.error_report', ['content' => $e->getMessage()], function ($m) {
        $m->to('mail@domain.com', 'Name')->subject('Error Report');
    });
    return parent::report($e);
    }

    return parent::report($e);
    }



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire