Spiral
5 months ago
326
2
Laravel

validation of json file

Posted 5 months ago by Spiral

I want to validate json file with it extension only but doesn't work

these are codes i tried

$rule = [
            'file' => 'required|mimes:json',
        ];
if(!$this->validateRequest($request, $rule)) {
            return response()->json($this->response, $this->responseCode);
        }
$file      = $request->file('file'); 


getting error The file must be a file of type: json.

Please sign in or create an account to participate in this conversation.