when i submit a form and run form validation then it gaves me this error but my form validation is working on other page In that file \vendor\laravel\framework\src\Illuminate\Validation\Validator.php
/**
* Handle dynamic calls to class methods.
*
* @param string $method
* @param array $parameters
* @return mixed
*
* @throws \BadMethodCallException
*/
public function __call($method, $parameters)
{
$rule = Str::snake(substr($method, 8));
if (isset($this->extensions[$rule])) {
return $this->callExtension($rule, $parameters);
}
throw new BadMethodCallException(sprintf(
'Method %s::%s does not exist.', static::class, $method
));
}
Errror= Method Illuminate\Validation\Validator::validateRequest does not exist
Maybe you wrote request instead of required? Like here:
$data = $request->validate([
'field' => 'request|string|max:255',
]);
Trying to fire validateRequest method suggest you were trying to use 'request' validation rule which doesn't exist.
All valid rules you can find here, but I think you just made a typo.
You should use a Validator facade class
In you Controller
use Validator;
See link Laravel validation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With