-
Notifications
You must be signed in to change notification settings - Fork 11k
New issue
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
save() and create() not working as expected #16782
Comments
i think if you don't have given default values to your db table columns it will throw |
@sagarrabadiya |
in that case it should throw |
@sagarrabadiya No. I don't have exception. |
@sagarrabadiya |
Unable to reproduce, please provide a simple example I can use on a fresh laravel 5.3 installation. |
ping @allok |
Look example in my repository https://github.com/allok/laravel |
Submitted a PR with a fix #16864 Thank you so much :) |
Description:
'exists' property on model wrong indicates if the model exists.
We need to know if a model really created.
You can check example: asanikovich/laravel@c3ad907
🔢 Config db, migrate and run 'php artisan test'
Steps To Reproduce:
Example migration for model buyer_users (user - default model):
Model should be with:
And if we try to create a model through save():
or create():
But the real row does not exists in DB.
The text was updated successfully, but these errors were encountered: