We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
I'm using your package and it works fine, however, I've faced an issue after saving a new Model and returning it as JSON.
When your trait update the indexes of the model being saved, something happens that you can't return your model directly into your response as json.
For example:
In my controller on the Store method:
$modelTest = new ModelTest(); // it uses your trait.
$modelTest->title = 'test'; $modelTest->description = 'apsdoj';
$modelTest->save();
return response()->json('modelTest', $modelTest, 201); // here it throws an error saying "Recursion detected".
That's it, to bypass that I've made another select to the model's id created and then I returned it.
Do you have an idea of what can it be?
Thanks.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello,
I'm using your package and it works fine, however, I've faced an issue after saving a new Model and returning it as JSON.
When your trait update the indexes of the model being saved, something happens that you can't return your model directly into your response as json.
For example:
In my controller on the Store method:
$modelTest = new ModelTest(); // it uses your trait.
$modelTest->title = 'test';
$modelTest->description = 'apsdoj';
$modelTest->save();
return response()->json('modelTest', $modelTest, 201); // here it throws an error saying "Recursion detected".
That's it, to bypass that I've made another select to the model's id created and then I returned it.
Do you have an idea of what can it be?
Thanks.
The text was updated successfully, but these errors were encountered: