{
"data": {
"id": "42",
"type": "article",
"attributes": {
"useful": false
}
}
}
/**
* Override patch, to "hack" boolean behaviour
* @param mixed $id
* @param object $attributes
* @return int
*/
public static function patch($id, $attributes)
{
if (isset($attributes['useful']) && $attributes['useful'] === false) {
$attributes['useful'] = 0;
}
return parent::patch($id, $attributes);
}