increments('id'); $table->string('name'); $table->string('email'); $table->string('password'); $table->rememberToken(); $table->timestamps(); if(env('DB_CONNECTION') == 'mysql'){ $table->unique([DB::raw('email(191)')]); }else{ $table->unique('email'); } }); //Insert default admin DB::table('users')->insert([ 'name' => 'Admin', 'email' => 'admin@example.com', 'password' => bcrypt('temp'), 'created_at' => NOW() ]); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('users'); } }