/** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { return $this->auth->onceBasic() ? $this->jsonRespond->setStatusCode(401)->respondWithError('Invalid credentials') : $next($request); }
public function response(array $errors) { return $this->jsonRespond->setStatusCode(422)->respondValidatorError($errors); }