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
{{ message }}
This repository has been archived by the owner on Dec 10, 2018. It is now read-only.
The HasBinaryUuid trait seems to forcefully convert the primary key to its text representation during toArray. Even if this was the wanted behavior, any other UUID fields are left on their own. For example, a "belongs to" scenario, where a user_id or user_uuid binary UUID exists, nothing is done to convert that field to text. That leads to unclear exceptions due to json_decode failing for the binary field.
For consistency, the primary key should probably not forcefully be converted to text. Instead we could add something like public $uuidFields = ['id', 'user_id']; to the models. A default value for $uuidFields could take care of the automatic conversion of the primary key, while the user may set $uuidFields = [] to disable that behavior.
The text was updated successfully, but these errors were encountered:
No need, the PR is still open, and I will look further into it when there's time. Unfortunately, I don't think I'll be able to give it attention anytime soon, so if you're up for it: feel free to fork the existing PR and submit it new one.
The
HasBinaryUuid
trait seems to forcefully convert the primary key to its text representation duringtoArray
. Even if this was the wanted behavior, any other UUID fields are left on their own. For example, a "belongs to" scenario, where auser_id
oruser_uuid
binary UUID exists, nothing is done to convert that field to text. That leads to unclear exceptions due tojson_decode
failing for the binary field.For consistency, the primary key should probably not forcefully be converted to text. Instead we could add something like
public $uuidFields = ['id', 'user_id'];
to the models. A default value for$uuidFields
could take care of the automatic conversion of the primary key, while the user may set$uuidFields = []
to disable that behavior.The text was updated successfully, but these errors were encountered: