jlsodai

Experience

50

0 Best Reply Awards

  • Member Since 8 Months Ago
  • 0 Lessons Completed
  • 0 Favorites

12th January, 2018

jlsodai started a new conversation Uniqid() Generating Same String On Each Create Record. • 5 months ago

I am quite new to Laravel and need your help. I want to create a unique string for the uniq field... But laravel is giving me the same value over and over again. Any help on why this is happening or a better way to generate a unique but not too long id (eg. 5a5971196db9e) will be much appreciated.

Schema::create('schools', function (Blueprint $table) {
            $table->increments('id');
            $table->string('uniq')->default(uniqid());
});
Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.