Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel validate enum field

$validator = Validator::make(Input::only(['username', 'password', 'type']), [
    'type' => 'in:DEFAULT,SOCIAL', // DEFAULT or SOCIAL values
    'username' => 'required|min:6|max:255',
    'password' => 'required|min:6|max:255'
]);
Comment

laravel enum validation

 'type' => 'in:DEFAULT,SOCIAL'
Comment

laravel enum validation

use AppEnumsServerStatus;
use IlluminateValidationRulesEnum;
 
$request->validate([
    'status' => [new Enum(ServerStatus::class)],
]);
Comment

PREVIOUS NEXT
Code Example
Php :: how to make zip in php by multiple files 
Php :: set postman global variable header 
Php :: laravel is route name 
Php :: wordpress add new page programmatically 
Php :: laravel get file in public folder 
Php :: php extract month and year from date 
Php :: unlink(p1): No such file or directory 
Php :: run a php project 
Php :: PHP strstr — Find the first occurrence of a string 
Php :: connect another database in wordpress 
Php :: add execute time php 
Php :: PHP filter_var() Function 
Php :: wp query meta in array 
Php :: the requested php extension bcmath is missing from your system 
Php :: laravel log 
Php :: PHP Fatal error: Allowed memory size of 134217728 bytes exhausted 
Php :: How to disable Gutenberg / block editor for certain post types 
Php :: merge array 
Php :: change field name in validation laravel 8 
Php :: grouping route in laravel 
Php :: cakephp get sql query string 
Php :: wordpress shortcode 
Php :: laravel collection toQuery 
Php :: check duplicate data in array php 
Php :: laravel amount migration 
Php :: how to link image in laravel 
Php :: define int variable in php 
Php :: count_chars (PHP 4, PHP 5, PHP 7, PHP 8) count_chars — Return information about characters used in a string 
Php :: how laravel return the old value 
Php :: laravel read csv file 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =