I have a Laravel 5.2 Backend API and a AngularJS Frontend and at some point I perform a laravel validation and return and error if validation fails.
When I iterate trough errors and display them on the frontend I get somthing like this:
["The email has already been taken."]
and I would like to be like this
The email has already been taken.
without the [""] stuff.
My code is:
Angular controller:
if (error.statusText === "Unprocessable Entity") {
$scope.registerErrors = error.data;
}
Angular template:
<div class="alert alert-warning animated pulse" ng-if="registerError && isLoading === false">
<p ng-repeat="(error, errorText) in registerErrors">{{errorText}}</p>
</div>
Laravel controller:
$this->validate($request, [
'firstname' => 'required|max:100|min:3',
'lastname' => 'required|max:100|min:3',
'email' => 'required|email|unique:users|max:255',
]);
Console.log:
Thanks in advance!

/[\[\]\'\"]/gwith''?