Skip to content
Advertisement

Tag: laravel-validation

Apache not return Laravel json validation errors on Test but works on Dev

I’ve been working on a Laravel API with validation. I’m sending this request to the server: On my development system, running windows/Apache/PHP 8.1, the POST requests return a JSON object containing validation errors. But my test system, running Linux/Apache/PHP 8.1, does not return a JSON response: Here is my code: api.php StoreClientRequest.php ClientAPIController.php Since it’s working on my localhost I

Custom validation not calling the passes() function

I am trying to make a validation that will check whether at least one item is provided in an array following the steps in Custom Validation Rules Routes.php ValidateArrayElementRule.php ExamPaperQuestionsController.php In my test file I have ExamPaperQuestionStoreRequest.php The test is failing Expected status code 422 but received 201. I can see the text “HERE” is logged but “there” is not.

FormRequest message in laravel 8 not show messages

In my laravel 8 app I am trying to create two files CreateUserRequest and updateUserRequest to use personalized validations. In the method rules I´m calling my model’s variable $createRules but when I send my form, this don´t send, don´t show messages, error… Nothing. I have attached CreateUserRequest, my model and controller’s store method: CreateUserRequest Model Controller’s store method In the

Advertisement