mardi 15 décembre 2015

laravel 5 make my own Error message when mysql error message flash

in handler.php

public function render($request, Exception $e)
{
     //i changed  
 // return parent::render($request, $e);
   //to
  return redirect()->back()->withErrors($e->errorInfo); 
}

in mysql student email unique

so when i tried to insert duplicate email i get error message as 23000 1062 Duplicate entry 'jon@yahoo.com' for key 'un_studentEmail'

which is go

what I need is that : i want to make change for flashing Error some thing like

The Email jon@yahoo.com is duplicate please enter other Email



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire