laravel validations

 illuminate vie middleware shareerrorsfromsessions middleware



accepted validation rules in laravel

AcceptedAccepted IfActive URLAfter (Date)After Or Equal (Date)AlphaAlpha DashAlpha NumericArrayBailBefore (Date)Before Or Equal (Date)BetweenBooleanConfirmedCurrent PasswordDateDate EqualsDate FormatDeclinedDeclined IfDifferentDigitsDigits BetweenDimensions (Image Files)DistinctEmailEnds WithEnumExcludeExclude IfExclude UnlessExclude WithoutExists (Database)FileFilledGreater ThanGreater Than Or EqualImage (File)InIn ArrayIntegerIP AddressMAC AddressJSONLess ThanLess Than Or EqualMaxMIME TypesMIME Type By File ExtensionMinMultiple OfNot InNot RegexNullableNumericPasswordPresentProhibitedProhibited IfProhibited UnlessProhibitsRegular ExpressionRequiredRequired IfRequired UnlessRequired WithRequired With AllRequired WithoutRequired Without AllSameSizeSometimesStarts WithStringTimezoneUnique (Database)URLUUID

$this ->validate();

$this->validate($request,[]);

$this->validate($request, [

'title' =>'required|min:2|max:50',
'image'=> 'required|mimes:jpeg,jpg,png|max:5120',
'description' =>'required|min:2',
'meta_desc' =>'required|min:2|max:255',
'category' =>'required|min:2|max:50',


]);
  1. Which method is used to validate incoming HTTP Requests?

    Marked Answer : validate()

    Correct Answer : validate()

  2. The validate() method is provided by _______ object.

    Marked Answer : IlluminateHttpValidate

    Correct Answer : Illuminate\Http\Request

  3. Which validation rule is used to Stopping On First Validation Failure?

    Marked Answer : unique

    Correct Answer : bail

  4. Which variable is shared with all of application's views?

    Marked Answer : $error

    Correct Answer : $errors

  5. ____ Blade directive is used to determine if validation error messages exist for a given attribute.

    Marked Answer : "@error"

    Correct Answer : "@error"

No comments:

Post a Comment

Event listening in react

 How we can listen to som eevents some envents fire like click or automatically user enters into input button , that is event on word type i...