php - Laravel 5.3 pass multiple MessageBag instances to $errors variable -


i have 2 modal fields on page forms , need determine of model fields has error.

so question is:

how can pass multiple messagebag's $errors able check errors using $errors->errortype->get('message')?

you can pass json message since string

{ "message1":"foo", "message2":"bar", } 

then

$results = json_decode($errors->errortype->get('message'),true);   print_r($results['message1']; print_r($results['message2']; 

Comments

Popular posts from this blog

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

javascript - Confirm a form & display message if form is valid with JQuery -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -