<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        $spinTagPermission = \App\Models\Permission::where('route','spintag.index')->first();
        if(!is_null($spinTagPermission)){
            addChildPermission('Copy Spintag Template','1','web','0','0','all','3',null,$spinTagPermission->id,'clone_spintag');
        }
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        \App\Models\Permission::where('route','spintag.copy')->orWhere('permission','clone_spintag')->delete();
    }
};
