Completed
Push — develop ( 5abd4c...dae2aa )
by Abdelrahman
09:07
created

CreateMembersTable::up()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 35
Code Lines 29

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 35
rs 8.8571
c 0
b 0
f 0
cc 1
eloc 29
nc 1
nop 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 CreateMembersTable 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.auth.tables.members'), 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->auditableAndTimestamps();
0 ignored issues
show
Bug introduced by
The method auditableAndTimestamps() does not exist on Illuminate\Database\Schema\Blueprint. Did you maybe mean timestamp()?

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...
44
            $table->softDeletes();
45
46
            // Indexes
47
            $table->unique('email');
48
            $table->unique('username');
49
        });
50
    }
51
52
    /**
53
     * Reverse the migrations.
54
     *
55
     * @return void
56
     */
57
    public function down(): void
58
    {
59
        Schema::dropIfExists(config('cortex.auth.tables.members'));
60
    }
61
}
62