CreateAuthRoleUserPivotTable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 36
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     CreateRoleUserTable
8
 *
9
 * @author   ARCANEDEV <[email protected]>
10
 *
11
 * @see  \Arcanedev\LaravelAuth\Models\Pivots\RoleUser
12
 */
13
class CreateAuthRoleUserPivotTable extends Migration
14
{
15
    /* -----------------------------------------------------------------
16
     |  Constructor
17
     | -----------------------------------------------------------------
18
     */
19
20
    /**
21
     * CreateAuthRoleUserPivotTable constructor.
22
     */
23
    public function __construct()
24
    {
25
        parent::__construct();
26
27
        $this->setTable(config('laravel-auth.role-user.table', 'role_user'));
28
    }
29
30
    /* -----------------------------------------------------------------
31
     |  Main Methods
32
     | -----------------------------------------------------------------
33
     */
34
35
    /**
36
     * Run the migrations.
37
     */
38
    public function up()
39
    {
40
        $this->createSchema(function (Blueprint $table) {
41
            $table->unsignedInteger('role_id');
42
            $table->unsignedInteger('user_id');
43
            $table->timestamps();
44
45
            $table->primary(['user_id', 'role_id']);
46
        });
47
    }
48
}
49