check() and $this->ajax(); } /** * Get the validation rules that apply to the request. * * @return array */ public function rules(): array { return [ 'modelName' => 'required|string|between:3,255|regex:/^[a-z]+(?:_[a-z]+)*$/', 'selectedEntry' => "required|numeric|exists:{$this->input('modelName')},id", ]; } }