Passed
Push — dev5 ( b08d9a...c43caf )
by Ron
04:08
created

CreateUsersTable::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 24
Code Lines 20

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 20
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 24
rs 9.6
1
<?php
2
3
use Illuminate\Support\Facades\Schema;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Database\Migrations\Migration;
6
use App\User;
7
8
class CreateUsersTable extends Migration
9
{
10
    /**
11
     * Run the migrations.
12
     *
13
     * @return void
14
     */
15
    public function up()
16
    {
17 View Code Duplication
        Schema::create('users', function(Blueprint $table) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
18
            $table->increments('user_id');
19
            $table->string('username')->unique;
20
            $table->string('first_name');
21
            $table->string('last_name');
22
            $table->string('email')->unique();
23
            $table->string('password');
24
            $table->rememberToken();
25
            $table->boolean('active');
26
            $table->boolean('is_installer')->default(0);
27
            $table->timestamp('password_expires')->nullable();
28
            $table->timestamps();
29
        });
30
        
31
        User::create([
32
            'user_id'      => 1,
33
            'username'     => 'admin',
34
            'first_name'   => 'System',
35
            'last_name'    => 'Administrator',
36
            'email'        => '[email protected]',
37
            'password'     => bcrypt('password'),
38
            'active'       => 1 // ,
39
//            'is_installer' => 1
40
        ]);
41
    }
42
43
    /**
44
     * Reverse the migrations.
45
     *
46
     * @return void
47
     */
48
    public function down()
49
    {
50
        Schema::dropIfExists('users');
51
    }
52
}
53