You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (! isset(static::$guardableColumns[get_class($this)])) {
The reason I ask is that in one of our packages we use a generic model class which sets the table name on instantiation. This means that when we load up the same model with a different table which may have different columns. The guardable columns will have cached the result from the previous model even though we are now using a different table.
Granted this might be unusual way to use a model but I was wondering if it made sense to use the table name instead for caching. Might also need to include the connection name to as well ....
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
This is related to pull request #33777
framework/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php
Line 217 in 0d1ac32
The reason I ask is that in one of our packages we use a generic model class which sets the table name on instantiation. This means that when we load up the same model with a different table which may have different columns. The guardable columns will have cached the result from the previous model even though we are now using a different table.
Granted this might be unusual way to use a model but I was wondering if it made sense to use the table name instead for caching. Might also need to include the connection name to as well ....
Beta Was this translation helpful? Give feedback.
All reactions