EscolaLMS/Consultations

View on GitHub
database/migrations/2022_03_29_091847_add_new_permission_migrate.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

use EscolaLms\Consultations\Enum\ConsultationsPermissionsEnum;
use Illuminate\Database\Migrations\Migration;
use Spatie\Permission\Models\Permission;

class AddNewPermissionMigrate extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Permission::findOrCreate(ConsultationsPermissionsEnum::CONSULTATION_CHANGE_TERM, 'api');
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Permission::findOrCreate(ConsultationsPermissionsEnum::CONSULTATION_CHANGE_TERM, 'api');
    }
}