route('banned_ip')); } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { /** @var \App\Models\BannedIp */ $ipToBanModel = $this->route('banned_ip'); return [ 'ip' => [ 'required', 'ip', Rule::unique('banned_ips', 'ip') ->ignore($ipToBanModel->ip, 'ip') ], ]; } }