“Laravel Validasi Unik di Beberapa Kolom” Kode Jawaban

Laravel Validasi Dua Kolom Unik

[
     'column_1' => 'required|unique:TableName,column_1,' . $this->id . ',id,colum_2,' . $this->column_2
]
santosh khanal

Laravel unik beberapa kolom

$table->unique(['mytext', 'user_id']);
Tough Tarsier

Cek unik dengan beberapa kolom validasi Laravel

'name' => 'unique:table,field,NULL,id,field1,value1,field2,value2,field3,value3'
Breakable Buzzard

Laravel Validasi Unik di Beberapa Kolom

'mobile_no' 
  => 'unique:users,mobile_no,NULL,id,country_id,'.request('country_id');
Lokesh003

Laravel 8 Validasi Unik 2 Kolom

// in my case, just add more unique rule
'phone1' =>'string|unique:tbl_users,phone1|unique:tbl_users,phone2|different:phone2|min:2',
'phone2' =>'string|unique:tbl_users,phone2|unique:tbl_users,phone1|different:phone1|min:2',
hirohito

Laravel Validasi Dua kolom unik

$messages = [
    'data.ip.unique' => 'Given ip and hostname are not unique',
];

Validator::make($data, [
    'data.ip' => [
        'required',
        Rule::unique('servers')->where(function ($query) use($ip,$hostname) {
            return $query->where('ip', $ip)
            ->where('hostname', $hostname);
        }),
    ],
],
$messages
);
Mouawia Youmbai

Jawaban yang mirip dengan “Laravel Validasi Unik di Beberapa Kolom”

Pertanyaan yang mirip dengan “Laravel Validasi Unik di Beberapa Kolom”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya