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
Using UUID's for primary ID results in incorrect truncation #16576
Comments
Ah. If I name the column something different (I also have a |
Make sure you have properly defined the primary key in your model:
|
Please continue on the forums, Twig is not supported by default in Laravel and thus all Twig related issues shouldn't be discussed in laravel's core repository. On the forums you'll find many others who use Twig that are able to help you. Thanks :) |
Hello, @themsaid ! |
If so, can you please try |
Sorry - I did try calling it in normal code both with echo and with
error_log and got the truncation. I got confused because var dump reports
the key is there and it's a string. I'll try those properties on the model,
thanks!
…On Tue, Nov 29, 2016 at 05:11 Mohamed Said ***@***.***> wrote:
If so, can you please try $conference->id in a controller and see if you
get the full string? or using blade? If it works there then Twig trims the
value in a way.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#16576 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAOSI373aNp5n1iBSo3wVYZvCEdLKYCfks5rDCSGgaJpZM4K-bnR>
.
|
Maybe this is a documentation problem, https://laravel.com/docs/5.3/eloquent does not mention |
Description:
If I have a table with a UUID column, and echo that column or render it in a Twig template, the value gets truncated to the first two characters.
Steps To Reproduce:
Create a table with a UUID column, for example
and then have a Eloquent model:
If I do for example
Only the first two characters are printed.
The same holds if I pass this value to a Twig template.
If I
var_dump
the model instance, I see thatid
contains the entire string, so I'm not sure where it's being truncated.I can get the right value out if I do $this->attributes['id'] from inside the model, but I don't have access to this from outside. I'm working around this for the moment by adding a
correct_id
function to my model, which returns $this->attributes['id'].The text was updated successfully, but these errors were encountered: