<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddAuthorityUpdateOrderPackagesExceptionType extends Migration
{

    protected $authorities = [
        "包裹管理-快递-异常类型-编辑",
    ];
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        foreach ($this->authorities as $authority){
            \App\Authority::query()->firstOrCreate(["name"=>$authority],["name"=>$authority,"alias_name"=>$authority]);
        }
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        foreach ($this->authorities as $authority){
            \App\Authority::query()->where('name', $authority)->delete();
        }
    }
}
