Completed
Pull Request — master (#1)
by ARCANEDEV
04:05
created

CreateAuthPermissionsGroupTable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4
Metric Value
wmc 2
lcom 1
cbo 4
dl 0
loc 36
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A up() 0 12 1
1
<?php
2
3
use Arcanedev\LaravelAuth\Bases\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Support\Facades\Schema;
6
7
/**
8
 * Class     CreatePermissionsTable
9
 *
10
 * @author   ARCANEDEV <[email protected]>
11
 */
12
class CreateAuthPermissionsGroupTable extends Migration
13
{
14
    /* ------------------------------------------------------------------------------------------------
15
     |  Constructor
16
     | ------------------------------------------------------------------------------------------------
17
     */
18
    /**
19
     * Make a migration instance.
20
     */
21
    public function __construct()
22
    {
23
        parent::__construct();
24
25
        $this->setTable(config('laravel-auth.permissions-group.table'));
26
    }
27
28
    /* ------------------------------------------------------------------------------------------------
29
     |  Main Functions
30
     | ------------------------------------------------------------------------------------------------
31
     */
32
    /**
33
     * Run the migrations.
34
     */
35
    public function up()
36
    {
37
        Schema::connection($this->connection)->create($this->table, function (Blueprint $table) {
38
            $table->increments('id');
39
            $table->string('name');
40
            $table->string('slug');
41
            $table->string('description')->nullable();
42
            $table->timestamps();
43
44
            $table->unique('slug');
45
        });
46
    }
47
}
48