0

I'm using snowflake IDs which are bigInts for my Laravel API project, Vuejs/JS does not support the size of the IDs so requires them to be converted to strings.

If I cast all my IDs in each model

protected $casts = [
    'id' => 'string',
];

Does Laravel use these value types for relationships therefore slowing queries comparing strings apposed to ints?

Is there a way to have all responses convert the ID's to strings without affecting the model itself and it's relationships?

4
  • Vue supports perfectly Commented Oct 21, 2022 at 10:44
  • It seems to round the numbers link @garry I believe (if not mistaken) it's best to send strings and not have to let the froundend handle them. Commented Oct 21, 2022 at 11:42
  • where do you use snowflake ID in vue ? Commented Oct 21, 2022 at 14:11
  • One of the places would be vuetify's v-select @Garry Commented Oct 21, 2022 at 15:32

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.