Passed
Push — master ( 522ba7...dac3f8 )
by Andrey
13:44
created

CreateUserPermissionTable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 14
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A down() 0 7 1
A up() 0 3 1
1
<?php
2
3
use Helldar\Roles\Support\Database\BaseMigration;
4
5
class CreateUserPermissionTable extends BaseMigration
6
{
7
    public function up()
8
    {
9
        $this->createPivot($this->user_permission, $this->users, $this->permissions, 'user_id', 'permission_id');
10
    }
11
12
    public function down()
13
    {
14
        $this->schema()->disableForeignKeyConstraints();
15
16
        $this->dropTables($this->user_permission);
17
18
        $this->schema()->enableForeignKeyConstraints();
19
    }
20
}
21