Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel exists validation query two tables

class RegRequest extends BaseRequest
{
    public function rules()
    {
        return [
            'l_name'  => 'required|string|max:255',
            'f_name'  => 'required|string|max:255',
            'm_name'  => 'nullable|string|max:255',
            'contact' => [
                'required',
                is_numeric($this->contact) ? 'digits:12' : 'email',
                'unique:users,phone',
                'unique:users,email',
            ],
            'pass'    => 'required|string|min:6|confirmed',
        ];
    }
}
Comment

laravel validation exists multiple tables laravel

$validator = Validator::make($request->all(), [
    'title' => [
        'required',
        'max:255',
        function($attribute, $value, $fail) {
            if ($value === 'foo') {
                return $fail($attribute.' is invalid.');
            }
        },
    ],
]);
Comment

PREVIOUS NEXT
Code Example
Php :: remove spaces from string php 
Php :: google client php get inbox messages 
Php :: convert object to array php 
Php :: route group controller laravel 
Php :: laravel forelse 
Php :: laravel_8 
Php :: laravel-admin Model does not exists ! 
Php :: contact form 7 select disabled option 
Php :: get today date in php 
Php :: count in string php 
Php :: carbon in laravel 
Php :: how to get time php with am/pm 
Php :: DB::rollback() 
Php :: php regex strin start with 
Php :: laravel eloquent get 3 months 
Php :: scan all directories and files php 
Php :: if button is clicked php 
Php :: php déclarer une constante URL 
Php :: how to get all roles in wordpress 
Php :: php guzzle client x-www-form-urlencoded 
Php :: woocommerce action order complete 
Php :: laravel mongodb delete 
Php :: run raw sql with doctrine manager 
Php :: laravel select all except some columns 
Php :: php check if url parameter exists 
Php :: php array to csv 
Php :: php remove object from array by property 
Php :: laravel bootstrap nav active 
Php :: php artisan drop table 
Php :: php generate random string 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =