$table->string('поле1');
$table->integer('поле2');
$table->unique(['поле1', 'поле2']);
$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
);