Completed
Pull Request — master (#23)
by ARCANEDEV
08:07
created

CreateAuthPermissionRolePivotTable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 34
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A up() 0 10 1
1
<?php
2
3
use Arcanedev\LaravelAuth\Bases\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
6
/**
7
 * Class     CreatePermissionRoleTable
8
 *
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class CreateAuthPermissionRolePivotTable extends Migration
12
{
13
    /* -----------------------------------------------------------------
14
     |  Constructor
15
     | -----------------------------------------------------------------
16
     */
17
    /**
18
     * CreateAuthPermissionRolePivotTable constructor.
19
     */
20
    public function __construct()
21
    {
22
        parent::__construct();
23
24
        $this->setTable('permission_role');
25
    }
26
27
    /* -----------------------------------------------------------------
28
     |  Main Methods
29
     | -----------------------------------------------------------------
30
     */
31
    /**
32
     * Run the migrations.
33
     */
34
    public function up()
35
    {
36
        $this->createSchema(function (Blueprint $table) {
37
            $table->unsignedInteger('permission_id');
38
            $table->unsignedInteger('role_id');
39
            $table->timestamps();
40
41
            $table->primary(['permission_id', 'role_id']);
42
        });
43
    }
44
}
45