So I am trying to submit a form using the store method with the following code
public function store(Request $request)
{
$data = $request->validate([
'engagement_id' => 'required|integer',
'question' => 'required|string',
'answered' => 'required|boolean',
]);
$question = Question::create($data);
return response($question, 201);
}
Now when I submit the form with the field for question set to
'question' => 'required|string',
It will seem to validate the request but my question field is set to be [text] data type...
However if I submit the form as
'question' => 'required|text',
I will get the following message
BadMethodCallException: Method Illuminate\Validation\Validator::validateText does not exist. in file C:\laragon\www\traxit\vendor\laravel\framework\src\Illuminate\Validation\Validator.php on line 1158
Stack trace:
So should I change the question field to a [string] data type? or is there a way I can have it validate a [text] data type?