laravel 查询之大小写敏感
其实和laravel 无关,只需在MySQL执行:
ALTER TABLE '表名' CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
如果是数据迁移:
Schema::create('info', function (Blueprint $table) {
$table->increments('id');
$table->charset = 'utf8';
$table->collation = 'utf8_bin';
$table->timestamps();
});
\DB::statement("ALTER TABLE `info` comment '详情'");