CreatePermissionsTables   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 44
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 21 1
A down() 0 7 1
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use \jlourenco\base\Database\Blueprint;
5
6
class CreatePermissionsTables extends Migration
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
7
{
8
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
17
        Schema::create('Permission', function (Blueprint $table) {
18
            $table->increments('id');
19
            $table->string('key', 100);
20
            $table->string('description', 250);
21
22
            $table->unique('key');
23
        });
24
25
        Schema::create('Permission_Entity', function (Blueprint $table) {
26
            $table->increments('id');
27
            $table->text('permission');
28
29
            $table->timestamps();
30
            $table->softDeletes();
31
            $table->creation();
32
        });
33
34
    }
35
36
    /**
37
     * Reverse the migrations.
38
     *
39
     * @return void
40
     */
41
    public function down()
42
    {
43
44
        Schema::drop('Permission_Entity');
45
        Schema::drop('Permission');
46
47
    }
48
49
}
50