Completed
Push — develop ( 0e4d6e...a935b5 )
by Wisoot
02:16
created

CreateJwtClaimsTable::down()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
use Illuminate\Database\Schema\Blueprint;
4
use Illuminate\Database\Migrations\Migration;
5
use Illuminate\Support\Facades\Config;
6
use Illuminate\Support\Facades\Schema;
7
8
class CreateJwtClaimsTable extends Migration
9
{
10
11
    /**
12
     * @var string $tableName - Table name.
13
     */
14
    protected $tableName;
15
16
    /**
17
     * Initialise the migration.
18
     */
19
    public function __construct()
20
    {
21
        $this->tableName = Config::get('jwt.claim_table_name');
22
    }
23
24
    /**
25
     * Run the migrations.
26
     *
27
     * @return void
28
     */
29
    public function up()
30
    {
31
        Schema::create($this->tableName, function (Blueprint $table) {
0 ignored issues
show
Bug introduced by
The method create() does not exist on Illuminate\Support\Facades\Schema. Did you maybe mean createFreshMockInstance()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
32
            $table->increments('id');
33
            $table->string('subject')->unsigned();
34
            $table->string('audience')->unsigned();
35
            $table->string('jwt_id')->index();
36
            $table->timestamps();
37
        });
38
    }
39
40
    /**
41
     * Reverse the migrations.
42
     *
43
     * @return void
44
     */
45
    public function down()
46
    {
47
        Schema::drop($this->tableName);
48
    }
49
50
}
51