Closed aceart closed 7 years ago
Hi @aceart
Thanks for this!
Shouldn't we use the approach we discussed in #445? which has the starts_with
or else we might break it for users using standard laravel features outside of Angular
Hi @jadjoubran I can change it. But isn't the if-statement obsolete. The if-statement would be:
if ($validator->fails()) {
if (Route::current()->getPrefix() === 'api' || starts_with(Route::current()->getPrefix(), 'api/')) {
throw new ValidationException($validator);
} else {
throw new ValidationException($validator);
}
}
so the if-block does the same as the else-block. Is there any case I did not recognize?
Sorry you're absolutely right Thanks again!
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)