Here is the json data I send through postman for 'specification' field:
{
"specification": [
{
"type": [
{
"type": "Smartphone , Phablet , Notch Phone , Camera Phone , Selfie Phone",
"shape": "Bar"
}
],
"basic": [
{
"os": "Smartphone , Phablet , Notch Phone , Camera Phone , Selfie Phone",
"Sim": "Bar"
}
]
}
]
}
Then in controller the validation rule is:
'specification' => 'required|json'
The error message: "The specification must be a valid JSON string."
how can I send and check valid json in laravel controller?