Laravel: ValidationException возвращает 500, вместо 422
6 USDДобрый день, нужна помощь опытного программиста Laravel.
Столкнулся с проблемой возврата данных в формах: login, register, restore.
При попытке выполнить скрипт:
protected function sendFailedLoginResponse(Request $request)
{
throw ValidationException::withMessages([
$this->username() => [trans('Неверный логин или пароль, проверьте <br> введённые данные и нажмите «Вход» ещё раз')],
]);
}
Получаю ответ сервера 500, вместо 422.
Есть точно такой же сайт на тестовом домене, там нет проблем, возвращает 422. Проблема именно с новым доменом.
Версии PHP одинаковые, домен везде где можно изменен, включая пути.
Добавлю, если распечатать при помощи dump работу функции выше, то в ответе видим правильные данные:
ValidationException {#455 ▼
+validator: Validator {#451 ▼
#translator: Translator {#200 ▶}
#container: Application {#2 ▶}
#presenceVerifier: DatabasePresenceVerifier {#438 ▶}
#failedRules: []
#messages: MessageBag {#448 ▼
#messages: array:1 [▼
"email" => array:1 [▼
0 => "Неверный логин или пароль, проверьте <br> введённые данные и нажмите «Вход» ещё раз"
]
]
#format: ":message"
}
#data: []
#initialRules: []
#rules: []
#currentRule: null
#implicitAttributes: []
#distinctValues: []
#after: []
+customMessages: []
+fallbackMessages: []
+customAttributes: []
+customValues: []
+extensions: []
+replacers: []
#fileRules: array:9 [▶]
#implicitRules: array:10 [▶]
#dependentRules: array:18 [▶]
#sizeRules: array:8 [▶]
#numericRules: array:2 [▶]
}
+response: null
+status: 422
+errorBag: "default"
+redirectTo: null
#message: "The given data was invalid."
#code: 0
#file: "/home/v/vladish1/mydomain.ru/public_html/vendor/laravel/framework/src/Illuminate/Validation/ValidationException.php"
#line: 71
trace: {▶}
}Однако при возврате функции через throw ответ сервера 500.
Не понимаю что за ерунда, оплачу ваше время.
Current freelance projects in the category Web Programming
Development of a WebGL/Three.js scene with generation and export of 3D (snapshot) from an animated shaderObject Description:The project is a designer table shaped like a realistic, deep whirlpool (a central vortex that smoothly transitions from a wide horizontal tabletop to a thin elegant leg). Task Essence:A WebGL / Creative Coding developer is required to create an interactive 3D… Javascript and Typescript, Web Programming ∙ 5 hours 16 minutes back ∙ 15 proposals |
Create a website on WP, without a builder.
356 USD
Need to create a catalog (most likely without a cart) just a product request form without using Elementor and others there should be a main page, product page, catalog, supplier catalog, and possibly a few others design and style like this… Web Programming ∙ 5 hours 23 minutes back ∙ 65 proposals |
Shopify developer for sushi delivery website (Poland)We are looking for an experienced Shopify developer to implement a food delivery website (sushi) for a client from Katowice, Poland. What needs to be done: Set up the site on a ready-made Shopify template (template to be agreed upon) Menu with photos of dishes and descriptions… Web Programming ∙ 6 hours 48 minutes back ∙ 31 proposals |
Webflow developer for filling portfolio pages on the websiteA website custom-built on Webflow for a construction company needs to quickly fill project pages using one template (replace images and texts) For 2 languages Quantity - 6 pieces Ready to start asap, thank you! HTML & CSS, Web Programming ∙ 22 hours 43 minutes back ∙ 37 proposals |
LearnWorlds Administrator-ConfiguratorTask Set up the ready-made LearnWorlds platform for an elite online course. Do not develop the architecture — implement the already prepared structure manually in the admin panel. ———————— What needs to be done: Branding ⦁ Connect your domain ⦁ Upload the logo, set up… Content Management Systems, Web Programming ∙ 1 day 1 hour back ∙ 9 proposals |