Skip to content

Instantly share code, notes, and snippets.

@peterlafferty
Last active September 15, 2017 19:00
Show Gist options
  • Select an option

  • Save peterlafferty/0db1d5af5c8b7da43dbf9713be188f33 to your computer and use it in GitHub Desktop.

Select an option

Save peterlafferty/0db1d5af5c8b7da43dbf9713be188f33 to your computer and use it in GitHub Desktop.
<?php
if (count($errors) > 0) {
$messages = [];
foreach ($errors as $error) {
$messages[] = $error->getPropertyPath() . ' ' . $error->getMessage();
}
return new Utf8JsonResponse($messages, 400);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment