We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Take this validation request as an example:
public function rules() { return [ 'organisation_id' => ['required', Rule::in(Organisation::pluck('id'))], 'name' => ['required'], 'function' => ['required'], 'email' => ['nullable', 'mail'], 'phone1' => ['required', new PhoneNumberRule], 'phone2' => ['nullable', new PhoneNumberRule] ]; }
Rule::in will cause preg_match() expects parameter 2 to be string, object given at
Rule::in
preg_match() expects parameter 2 to be string, object given
protected function isDateFormat($rules) { $format = array_filter($rules, function($val){ return preg_match('/^date_format/', $val); // $val = Class }); return count($format); }
A potential fix would be to change This piece of code to something like
foreach ($this->params as $key => $val) { $rules = $this->rules[$key]; $rules = array_map(function ($rule) { if (is_object($rule)) { return mb_strtolower(class_basename($rule)); } return $rule; }, $rules); $case[$val] = $this->getValue($val, $rules); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Take this validation request as an example:
Rule::in
will causepreg_match() expects parameter 2 to be string, object given
atA potential fix would be to change This piece of code to something like
The text was updated successfully, but these errors were encountered: