3 use Illuminate\Database\Migrations\Migration;
4 use Illuminate\Database\Schema\Blueprint;
5 use Illuminate\Support\Facades\Schema;
6 use Illuminate\Support\Facades\DB;
8 class RemoveRoleNameField extends Migration
17 Schema::table('roles', function (Blueprint $table) {
18 $table->dropColumn('name');
23 * Reverse the migrations.
27 public function down()
29 Schema::table('roles', function (Blueprint $table) {
30 $table->string('name')->index();
33 DB::table('roles')->update([
34 "name" => DB::raw("lower(replace(`display_name`, ' ', '-'))"),