I have communities list on my page and each community item has a delete button. Now when I click on a delete button I want to delete related community item. But… I can inspect these delete buttons from the browser and change it’s data-id value to something else(if a data-id of a delete button is 10, I can change it
Tag: validation
how to exclude a rule in laravel validation
I am building a user’s resignation inside the dashboard with Form Request Validation. it works well in store resource, but I need to exclude the password role in updating resource, so if the user leaves it empty I will store the old password my validation file Answer In this case just use ‘sometimes’ for updating password and not ‘required’. Validating
Symfony 5 using the validation to validate a new entity
I’m using Symfony 5.3.7, and using the @Assert annotations, attempting to validate a new user upon registering. Trying to understand the docs however not getting anywhere. Ideally I’d like to be able to understand how to validate an entity using these annotations. I’ve tried using a separate class, and got nowhere with understanding, although I do want to go down
How to load data from cache to a form in a laravel application?
I’m developing a site in laravel. I have a view for editing and creating posts that brings the data stored from the database. For example: The problem is that when the user makes modifications, try to save the data and has validation errors, he loses all the modifications he made (because when laravel reloads the page, the data is again
PHP 8 Attributes: Is it possible to validate metadata passed to attributes or force attribute instantiation?
Playing a little bit with the new PHP 8 attributes (annotations) (https://stitcher.io/blog/attributes-in-php-8) I started to create my own ones. Simple example: Hoping that the following code would throw an BadAttributeMetadataException unfortunately it finishes successfully: Is there away to validate the metadata passed for (custom) attributes? Most probably the attributes have to be instantiated automatically somehow. Answer Everything is possible –
Visual Studio Code 1.56 PHP Validation not work
When I upgraded the VS Code from version 1.55 to version 1.56 the inline PHP validator stopped working (onType). I downgraded to 1.55 and everything works. Has anyone had this problem and how can I activate PHP validation in version 1.56? I tried HTML and JavaScript, this two validators works fine. Answer PRoblem is fixed in VS Code 1.57
How to prevent user from modifying submitted value in the form?
I have a simple form that sends a value to controller: This value will be static and this value cannot be modified. But of course it can be easily changed in Chrome dev tools. How can I better implement this? I though of doing validation like this: But it doesn’t work: What is good way of securing this value? Answer
Laravel 8.38 validation issue, max file size. RuntimeException: The file {public path} cannot be opened. in file Psr17Factory.php on line 46
Created the file validation as (for test purpose it is 5kb) There is a weird issue, as it is displaying a valid error on uploading png but on uploading mp4 it is throwing following error Answer Open icons tray on right side of your windows. left click on wamp icon. click on PHP > PHP Settings > upload_max_filesize = (set
Laravel 8 file upload validation fails with any rule
I want to validate a file upload but with literally any validation rule, I get “The (name of input) failed to upload.” I’ve seen this issue in a few places but none of the solutions worked for me. I’m using Laravel 8.0, php 8.0.2, and nginx/1.18.0 on ubuntu. Controller: Blade file: If I get rid of the validation rule for
Regex to match a string that contains substrings separated with dots
I need to get a value from an array using the dot notation. For example: So what I need to do is check if it’s a valid string by which we could get a value from array. Constraints: non-whitespace characters only contains at least one dot cannot start or end with a dot every dot must have a non-dot substring