Completed
Push — develop ( cc9a49...c1329f )
by Abdelrahman
09:49
created

CreateUsersTable::down()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
use Illuminate\Support\Facades\Schema;
6
use Illuminate\Database\Schema\Blueprint;
7
use Illuminate\Database\Migrations\Migration;
8
9
class CreateUsersTable 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...
10
{
11
    /**
12
     * Run the migrations.
13
     *
14
     * @return void
15
     */
16
    public function up(): void
17
    {
18
        Schema::create(config('cortex.fort.tables.users'), function (Blueprint $table) {
19
            // Columns
20
            $table->increments('id');
21
            $table->string('username');
22
            $table->string('password');
23
            $table->rememberToken();
24
            $table->string('email');
25
            $table->boolean('email_verified')->default(false);
26
            $table->timestamp('email_verified_at')->nullable();
27
            $table->string('phone')->nullable();
28
            $table->boolean('phone_verified')->default(false);
29
            $table->timestamp('phone_verified_at')->nullable();
30
            $table->string('name_prefix')->nullable();
31
            $table->string('first_name')->nullable();
32
            $table->string('middle_name')->nullable();
33
            $table->string('last_name')->nullable();
34
            $table->string('name_suffix')->nullable();
35
            $table->string('title')->nullable();
36
            $table->string('country_code', 2)->nullable();
37
            $table->string('language_code', 2)->nullable();
38
            $table->text('two_factor')->nullable();
39
            $table->date('birthday')->nullable();
40
            $table->string('gender')->nullable();
41
            $table->boolean('is_active')->default(true);
42
            $table->timestamp('last_activity')->nullable();
43
            $table->auditable();
44
            $table->timestamps();
45
            $table->softDeletes();
46
47
            // Indexes
48
            $table->unique('email');
49
            $table->unique('username');
50
        });
51
    }
52
53
    /**
54
     * Reverse the migrations.
55
     *
56
     * @return void
57
     */
58
    public function down(): void
59
    {
60
        Schema::dropIfExists(config('cortex.fort.tables.users'));
61
    }
62
}
63