enum('permission',['允许','禁止'])->after('alias_name')->default('允许')->comment('许可'); }); foreach ($this->authNames as $name){ if(!Authority::where('name',$name)->first())(new Authority(['name'=>$name,'alias_name'=>$name,'permission'=>'禁止']))->save(); } } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('authorities',function (Blueprint $table){ $table->dropColumn('permission'); }); foreach ($this->authNames as $name){ Authority::where('name',$name)->delete(); } } }