Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel Call to a member function validate() on array

//I see your problem It is because you are calling validate on array $data

return $data->validate([
                    'LieferNr' => ['required', 'min:5', 'max:5'],
                    'Produkt' => ['required'],
                    'PH' => ['required', 'numeric', "min:$PHmin", "max:$PHmax"],
                    'Wasser' => "required|numeric|min:$Wassermin|max:$Wassermax",
                    'Dichte' => "required|numeric|min:$Dichtemin|max:$Dichtemax",
                    'Bearbeiter' => ['required'],
                ]);

//Instead, do following

use IlluminateSupportFacadesValidator;
$validator = Validator::make($data, [
                    'LieferNr' => ['required', 'min:5', 'max:5'],
                    'Produkt' => ['required'],
                    'PH' => ['required', 'numeric', "min:$PHmin", "max:$PHmax"],
                    'Wasser' => "required|numeric|min:$Wassermin|max:$Wassermax",
                    'Dichte' => "required|numeric|min:$Dichtemin|max:$Dichtemax",
                    'Bearbeiter' => ['required'],
                ]);

if($validator->fails()){
 return 0;
}
Comment

PREVIOUS NEXT
Code Example
Php :: WooCommerce shop loop random array function not same values after each other 
Php :: laravel htaccess to remove public from url 
Php :: acf field without spaces 
Php :: Laravel eger load 
Php :: include vendor/autoload.php 
Php :: Mixed int and string keys 
Php :: how many products can a laravel ecommerce handle 
Php :: /([a-z-0-9-]*) php 
Php :: laravel $browser-keys alt click 
Php :: Remove Version from CSS and JS 
Php :: sample test tinker php artisan 
Php :: php ::class 
Php :: php to display variables 
Php :: cake php 2.x sql dump 
Php :: layer order matplotlib 
Php :: email in ctf 
Php :: What does this mean in PHP: - or = 
Php :: ftp login wordpress not working 
Php :: how-to-customize-the-email-verification-email-from-laravel-8 
Php :: How to hide tax details from woocommerce order emails 
Php :: laravel how to fetch user from user model based on id from post 
Php :: laravel how to generate short link in laravel framework and relation with 3 model 
Php :: keep multiple values in select box after reload in php 
Php :: command ui is not found 
Php :: ReflectionException: Class "MagentoFrameworkAppHttpInterceptor" does not exist in /bitnami/magento/vendor/magento/framework/Code/Reader/ClassReader.php:34 
Php :: array issue in php 
Php :: Laravel database insert with combining array and string 
Php :: javascript date to php date site:stackoverflow.com 
Php :: id de sesion php 
Php :: Inject interface and not concrete class 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =