CreateFollowersTable::up()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
ccs 7
cts 7
cp 1
rs 9.6666
cc 1
eloc 6
nc 1
nop 0
crap 1
1
<?php
2
3
use Illuminate\Database\Schema\Blueprint;
4
use Illuminate\Database\Migrations\Migration;
5
6
class CreateFollowersTable 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
     * Run the migrations.
10
     *
11
     * @return void
12
     */
13
    public function up()
14
    {
15 18
        Schema::create('followers', function (Blueprint $table) {
16 18
            $table->increments('id');
17 18
            $table->unsignedInteger('user_id');
18 18
            $table->unsignedInteger('follow_id');
19 18
            $table->nullableTimestamps();
20 18
        });
21 18
    }
22
23
    /**
24
     * Reverse the migrations.
25
     *
26
     * @return void
27
     */
28
    public function down()
29
    {
30
        Schema::drop('followers');
31
    }
32
}