Support the ongoing development of →
Database Eloquent
Last updated 2 weeks ago.

You can't just let out the incremental ID and make sure your save method, when it's a new entry, generates an ID from your preference?


public $incrementing = false; on your model indicates the ids are not auto-incrementing.


In fact am looking to generate some random ID like Youtube.. Something like this: ggPo8mbb_dep and not use the simple numeric ID

Last updated 6 years ago.

Maybe it will be helpful => It creates YT-like IDs from number ID.


As lukasz mentioned, hashids are probably what you are looking for.


The problem is I have to rewrite the find method and some other method that give the ID... I wonder if there is a package or if someone already did it ?


Sign in to participate in this thread!


Your banner here too?

LonnyX LonnyX lonnyx Joined 30 Mar 2015


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

Your logo here?

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

© 2022 - All rights reserved.