jeudi 24 août 2017

Laravel 5.4 how to override the "Unknown error message pop-up" when using validate method

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 (on validation failure) and redirects returning HTTP:422, with the appropriate error(s) available in response; 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.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2wr0Uho
via IFTTT

Aucun commentaire:

Enregistrer un commentaire