Search
 
SCRIPT & CODE EXAMPLE
 

PHP

how to use required_with in laravel to array element

$validator = Validator::make($request->all(), [
    "currency"    => "nullable|required_with:price.*|string",
    //or if you want to check currency for first price then use
    // "currency"    => "nullable|required_with:price.0|string",
    "price"    => "required|array|min:3",
    "price.*"  => "required|string|distinct|min:3",
]);
Comment

PREVIOUS NEXT
Code Example
Php :: create new laravel project cmd 
Php :: artisan cache clear 
Php :: php string to char array 
Php :: remove repeated columns laravel 
Php :: php get random value from array 
Php :: HTML Snippets not working in .php files 
Php :: limit offset array php 
Php :: phpspreadsheet edit excel file 
Php :: show selected value in dropdown laravel 
Php :: Get color code from string 
Php :: ext-bcmath php 8.0 install 
Php :: php put print_r into variable 
Php :: php serialize 
Php :: tolower php 
Php :: php search in object. array 
Php :: laravel where condition on relationship 
Php :: laravel blade get authenticated user email 
Php :: php display errors 
Php :: unset session in php 
Php :: composer 
Php :: remove symbolsand spaces php 
Php :: how to check if PHP-FPM is running 
Php :: show query in laravel 
Php :: how to redirect a particular user role to a page after login laravel 
Php :: ucfirst meaning in php 
Php :: laravel faker title 
Php :: php superglobal 
Php :: php check version ubuntu 
Php :: laravel check record exists 
Php :: php increment letter 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =