Php has its own randomstring generator. You will just need to put a manual check if it exists already. If not try to create another random string. This should work, however I would not quite recommend it. I have no idea how laravel will respond to this.
As far as I know it wouldnt increase the security as you would mainly want no external access to the database itself. This atleast is how I do it.
What kind of security would you get by doing this?
If you are worried about using row id's in your URI's, you can try creating slugs with https://github.com/cocur/slugify or hashids https://github.com/ivanakimov/hashids.php
I'm using UUIDs as primary keys for all my models. Have a look at this: http://garrettstjohn.com/entry/using-uuids-laravel-eloquent-orm/
mruoss said:
I'm using UUIDs as primary keys for all my models. Have a look at this: http://garrettstjohn.com/entry/using-uuids-laravel-eloquent-orm/
Why would you adjust your models like that? Creating an extra column for your uuid and index it shouldn't be a big deal. Besides your going to have to adjust a lot more if you want to use Laravel's Relationships
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community