Open nohponex opened 7 years ago
{ "data": { "id": "42", "type": "article", "attributes": { "useful": false } } }
Using bypass
/** * 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); }
Using bypass