jeudi 24 août 2017

Laravel how to override the "Unknown error messsage" in response

if(!is_null($request->instagram_link)) {
      $this->validate($request, [
        'instagram_link'=> [
          'active_url',
          'regex:/^https?\:\/\/(www\.){0,1}instagram\.com\/(\S)+$/',
        ],
      ]);
    }

The code snippet above throws an exception and redirects returning HTTP:422, with the appropriate error response on validation failure; which is expected behaviour according to documentation. But it also brings a pop-up which says: Unknown error occured! I want to override the message pop-up to display the appropriate error contained in the response. A hint please on how to accomplish this.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire