-
Notifications
You must be signed in to change notification settings - Fork 11.3k
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
Exists property is set to false on soft deleted eloquent model #9794
Conversation
…amework into garygreen-make-migration-path
[5.1] Call message builder after the message content has been added
Create a helper as a shortcut for method spoofing
This is similar to how the query builder `select` method works and can probably be replicated throughout to make all the methods work in a similar way.
[5.1] Remove unused alias
[5.1] Console Parser
[5.1] Allow a string to be passed into the Model::all() method
[5.1] Cache Fixes
Fix typo in Parser.php
…lucasmichot/framework into lucasmichot-feature/console-parser-shortcut
Just suggestion, and it assumes we use the existing passwords.php file in resources/lang/en Thank you.
[5.1] Fixing docblock arguments
[5.1] Queue migration file name will now contain the right table name
[5.1] Remove unused statements
…ework into atrauzzi-add-inserted-state
[5.1] Forgot getBindings on whereExists
[5.1] Fix getCountForPagination backup/restore bindings.
…g the query. We then could use it like this: ``` return $resource->findOrFail($id) ->append(['custom_attribute']) ->toArray(); ```
Added public function getCustomDirectives to BladeCompiler
Adds integration test for issue #9794
Dunno why the pull request went haywire. Please close it. |
Actual patch can be found here 77f8b4d, feel free to open a new pull request if you're interested. |
Can you re-open at 5.1 please @HolgerW1. |
You sent to 5.0 instead of 5.1. |
I see, sorry for the mess. Don't know why hub used 5.0 as a base instead of 5.1, never had the 5.0 branch active. |
If you soft delete a model the property exists is set to false which may lead to problems.
Try the following code as a test:
Surprisingly the model won't be hard deleted because the first delete call will set the exists property to false thus the second call of forceDelete won't perform anything and the model remains in the DB.
Soft deleting a model should prevent setting the exists property to false because otherwise the model object is in an inconsistent state and any logic relying on this property to check if a model was deleted will fail.