Search
 
SCRIPT & CODE EXAMPLE
 

PHP

IlluminateValidationRulesRequiredIf

use IlluminateSupportFacadesValidator;
    use IlluminateValidationRule;
    
    Validator::make($request->all(), [
        'role_id' => Rule::requiredIf($request->user()->is_admin),
    ]);
    
    Validator::make($request->all(), [
        'role_id' => Rule::requiredIf(function () use ($request) {
            return $request->user()->is_admin;
        }),
    ]);
Comment

PREVIOUS NEXT
Code Example
Php :: php undefined index 
Php :: vendor folder command for custom errors laravel 
Php :: registration welcome email laravel 
Php :: stop php execution with javascript 
Php :: Autoriser les contributeurs à télécharger des images 
Php :: wc php get order get coupon discount amount 
Php :: strtolower cyrillic 
Php :: collection methods laravel 
Php :: laravel route name with parameters 
Php :: laravel get fetch api request body 
Php :: push element in array php 
Php :: assign multiple variables php 
Php :: read file and convert each line in array php 
Php :: php sort 
Php :: Laravel9 Failed to listen on 127.0.0.1:8000 (reason: ?) 
Php :: how to convert youtube video to mp3 in php 
Php :: return true false laravel 
Php :: add method to laravel blade 
Java :: minecraft bedrock file location 
Java :: java get next enum 
Java :: for with two values java 
Java :: javafx dependency 
Java :: android open browser 
Java :: android cardview dependency 
Java :: java selenium new window 
Java :: android round double to 2 decimal 
Java :: How to implement a Trie data structures in Java? 
Java :: get drawable with string android java 
Java :: java measure execution time 
Java :: padding a string with 0 in java 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =