protected function updateResourceCallable()
{
return function (Model $model, array $data, array $values, ErrorBag $errorBag) {
foreach ($values as $attribute => $value) {
$model->{$attribute} = $value;
}
try {
$model->update();
} catch (\Exception $e) {
$errorBag[] = new Error('update_failed', 'Could not update resource.');
throw $e;
}
};
}