CreateContactsTable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
c 1
b 0
f 0
dl 0
loc 32
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A down() 0 3 1
A up() 0 15 1
1
<?php
2
3
use Illuminate\Support\Facades\Schema;
4
use Illuminate\Support\Facades\Artisan;
5
use Illuminate\Database\Schema\Blueprint;
6
use Illuminate\Database\Migrations\Migration;
7
8
class CreateContactsTable extends Migration
9
{
10
    /**
11
     * Run the migrations.
12
     *
13
     * @return void
14
     */
15
    public function up()
16
    {
17
        Schema::create('contacts', function (Blueprint $table) {
18
            $table->id();
19
            $table->string('name');
20
            $table->string('email')->nullable();
21
            $table->bigInteger('phone')->nullable();
22
            $table->tinyInteger('gender')->default(1);
23
            $table->string('address')->default('N/A');
24
            $table->boolean('favorite')->default(0);
25
            $table->boolean('active')->default(1);
26
            $table->timestamps();
27
        });
28
29
        Artisan::call('make:permission Contact --all');
30
    }
31
32
    /**
33
     * Reverse the migrations.
34
     *
35
     * @return void
36
     */
37
    public function down()
38
    {
39
        Schema::dropIfExists('contacts');
40
    }
41
}
42