I'm using Laravel's schema builder with mysql to make a unique column. But when I use the unique method it is case insensitive. I need it to be case sensitive. How can I do that?
Schema:
Schema::create('item', function (Blueprint $table) {
$table->increments('id');
$table->string('key')->unique();
$table->timestamps();
});
First entry into database:
$i = new Item;
$i->key = "Random_Key";
$i->save();
Second entry into database (returns duplicate entry error):
$i = new Item;
$i->key = "random_key";
$i->save();