There was an error while loading. Please reload this page.
2 parents b92bbd5 + 4d41fb0 commit ef50baeCopy full SHA for ef50bae
src/NilPortugues/Laravel5/JsonApi/Controller/JsonApiTrait.php
@@ -134,6 +134,9 @@ protected function createResourceCallable()
134
135
try {
136
$model->save();
137
+
138
+ //We need to load the model from the DB in case the user is utilizing getRequiredFields() on the transformer.
139
+ $model = $model->fresh();
140
} catch (\Exception $e) {
141
$errorBag[] = new Error('creation_error', 'Resource could not be created');
142
throw $e;
0 commit comments