mdn-backend / app /Shared /Exceptions /ValidationExceptionMapper.php
internationalscholarsprogram's picture
feat(membership): admin-driven account creation, real estate tier/investment work, in-progress monorepo migration state
b2dcf0f
Raw
History Blame Contribute Delete
457 Bytes
<?php
namespace App\Shared\Exceptions;
use Illuminate\Validation\ValidationException;
class ValidationExceptionMapper
{
public static function details(ValidationException $exception): array
{
return collect($exception->errors())
->map(fn (array $messages, string $field): array => [
'field' => $field,
'messages' => $messages,
])
->values()
->all();
}
}