Support the ongoing development of Laravel.io →
Database Eloquent Laravel
Last updated 1 year ago.
0
Solution

Models using string typed ID (e.q. UUIDs, ULIDS), must set the $keyType var to 'string'.

/**
 * The "type" of the primary key ID.
 *
 * @var string
 */
protected $keyType = 'int';

Strangely enough, Laravel doesn't raises any alert and your application will still be functionnal, but it will greatly impact your performances.

Last updated 1 year ago.
0
Solution selected by @duvalg

Sign in to participate in this thread!

Eventy

Your banner here too?

Gaël Duval duvalg Joined 19 Apr 2022

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.