Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

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',
        ];
    }
}
 
PREVIOUS NEXT
Tagged: #laravel #exists #validation #query #tables
ADD COMMENT
Topic
Name
5+8 =