<?php

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

class AddAuthorritiesMail extends Migration
{
    protected $authNames=[
        "基础设置-邮件",
    ];

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        foreach ($this->authNames as $name){
            \App\Authority::create(['name'=>$name,'alias_name'=>$name,'permission'=>'允许']);
        }
    }

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