Unikalna walidacja na aktualizacji laravel
public function rules()
{
return [
'email' => 'required|email|unique:users,email,'.$this->user->id,
];
}
Fine Fly
public function rules()
{
return [
'email' => 'required|email|unique:users,email,'.$this->user->id,
];
}
use Illuminate\Validation\Rule;
public function rules()
{
return [
'title' => [
'required',
Rule::unique('posts', 'title')->ignore($this->post)
]
];
}
public function rules()
{
return [
'email' => 'required|email|unique:users,email,'.$this->user->id,
];
}