|
|
@@ -0,0 +1,35 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+use Illuminate\Database\Migrations\Migration;
|
|
|
+use Illuminate\Database\Schema\Blueprint;
|
|
|
+use Illuminate\Support\Facades\Schema;
|
|
|
+
|
|
|
+class AddLaborCompanyAuthoritiy extends Migration
|
|
|
+{
|
|
|
+ protected $authorities = [
|
|
|
+ "劳务所-可见全部",
|
|
|
+ ];
|
|
|
+ /**
|
|
|
+ * Run the migrations.
|
|
|
+ *
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ public function up()
|
|
|
+ {
|
|
|
+ foreach ($this->authorities as $authority){
|
|
|
+ \App\Authority::query()->firstOrCreate(["alias_name"=>$authority],["name"=>$authority,"alias_name"=>$authority]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Reverse the migrations.
|
|
|
+ *
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ public function down()
|
|
|
+ {
|
|
|
+ foreach ($this->authorities as $authority){
|
|
|
+ \App\Authority::query()->where("alias_name",$authority)->delete();
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|