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

CreateAuthPermissionsGroupTable::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 12
rs 9.4286
cc 1
eloc 8
nc 1
nop 0
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