protected function isJson($value) { if (!is_string($value)) { return false; } json_decode($value); return json_last_error() == JSON_ERROR_NONE; }